From 940d59770d01110b6b2dff474decd837f003987c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 13:36:46 +0000 Subject: [PATCH 1/2] feat: add soft deletes to WorkspaceInvitation model Invitations were hard-deleted when cancelled, removing the audit trail. Add SoftDeletes trait and migration for deleted_at column so cancelled invitations are retained for auditing purposes. Fixes #22 Co-Authored-By: Claude Opus 4.6 (1M context) --- ...deletes_to_workspace_invitations_table.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Migrations/2026_03_24_000000_add_soft_deletes_to_workspace_invitations_table.php diff --git a/Migrations/2026_03_24_000000_add_soft_deletes_to_workspace_invitations_table.php b/Migrations/2026_03_24_000000_add_soft_deletes_to_workspace_invitations_table.php new file mode 100644 index 0000000..c31ace0 --- /dev/null +++ b/Migrations/2026_03_24_000000_add_soft_deletes_to_workspace_invitations_table.php @@ -0,0 +1,27 @@ +softDeletes(); + }); + } + + public function down(): void + { + Schema::table('workspace_invitations', function (Blueprint $table) { + $table->dropSoftDeletes(); + }); + } +}; -- 2.45.3 From a2e2b04e2af651f82b3e1ef888f634ee16deeefa Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 13:37:05 +0000 Subject: [PATCH 2/2] feat: add SoftDeletes trait to WorkspaceInvitation model Add the SoftDeletes import and trait usage so delete() calls perform soft deletes, preserving cancelled invitations for audit trail. Co-Authored-By: Claude Opus 4.6 (1M context) --- Models/WorkspaceInvitation.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Models/WorkspaceInvitation.php b/Models/WorkspaceInvitation.php index a832d10..fd46c23 100644 --- a/Models/WorkspaceInvitation.php +++ b/Models/WorkspaceInvitation.php @@ -8,6 +8,7 @@ use Core\Tenant\Database\Factories\WorkspaceInvitationFactory; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; @@ -16,6 +17,7 @@ class WorkspaceInvitation extends Model { use HasFactory; use Notifiable; + use SoftDeletes; protected static function newFactory(): WorkspaceInvitationFactory { -- 2.45.3