From f7566c34eadc037bc2b1f6834625b4e477781dcc Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 08:19:40 +0200 Subject: [PATCH 01/11] Change media column to nullable with default null --- database/migrations/2026_01_14_232321_create_posts_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2026_01_14_232321_create_posts_table.php b/database/migrations/2026_01_14_232321_create_posts_table.php index a4411363..bf9593a9 100644 --- a/database/migrations/2026_01_14_232321_create_posts_table.php +++ b/database/migrations/2026_01_14_232321_create_posts_table.php @@ -18,7 +18,7 @@ public function up(): void $table->uuid('workspace_id'); $table->uuid('user_id')->nullable(); $table->text('content')->nullable(); - $table->json('media')->default('[]'); + $table->json('media')->nullable()->default(null); $table->string('status')->default('draft'); $table->timestamp('scheduled_at')->nullable(); $table->timestamp('published_at')->nullable(); From 15cbe9616fbf10b1f190bc96df86c987454d7897 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 08:28:07 +0200 Subject: [PATCH 02/11] Change reactions column to nullable with default null --- .../migrations/2026_04_15_000001_create_post_comments_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2026_04_15_000001_create_post_comments_table.php b/database/migrations/2026_04_15_000001_create_post_comments_table.php index ee7769e7..ef1e40b2 100644 --- a/database/migrations/2026_04_15_000001_create_post_comments_table.php +++ b/database/migrations/2026_04_15_000001_create_post_comments_table.php @@ -16,7 +16,7 @@ public function up(): void $table->uuid('user_id')->nullable(); $table->uuid('parent_id')->nullable(); $table->text('body'); - $table->json('reactions')->default('[]'); + $table->json('reactions')->nullable()->default(null); $table->timestamps(); $table->foreign('post_id')->references('id')->on('posts')->cascadeOnDelete(); From 78bee705ff70d23372a44929e7fc796657a72ece Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 09:30:49 +0200 Subject: [PATCH 03/11] Change storage to public disk for media uploads --- app/Models/Traits/HasMedia.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Traits/HasMedia.php b/app/Models/Traits/HasMedia.php index c1b9cb5e..7fbb8590 100644 --- a/app/Models/Traits/HasMedia.php +++ b/app/Models/Traits/HasMedia.php @@ -88,7 +88,7 @@ public function addMedia(UploadedFile $file, string $collection = 'default', arr $filename = Str::uuid().'.'.$normalizedExt; $path = 'medias/'.$filename; - Storage::put($path, $normalizedBytes); + Storage::disk('public')->put($path, $normalizedBytes); return $this->media()->create([ 'group_id' => $groupId ?? Str::uuid()->toString(), @@ -126,7 +126,7 @@ public function addMediaFromPath(string $filePath, string $originalFilename, str $filename = Str::uuid().'.'.$normalizedExt; $storagePath = 'medias/'.$filename; - Storage::put($storagePath, $normalizedBytes); + Storage::disk('public')->put($storagePath, $normalizedBytes); return $this->media()->create([ 'group_id' => $groupId ?? Str::uuid()->toString(), From 3018c0353f76ab59545f77f31f2b9d3ae8ae3845 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 09:31:40 +0200 Subject: [PATCH 04/11] Change storage method to use public disk for assets --- app/Http/Controllers/App/AssetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/App/AssetController.php b/app/Http/Controllers/App/AssetController.php index eab0588d..0a89a4fb 100644 --- a/app/Http/Controllers/App/AssetController.php +++ b/app/Http/Controllers/App/AssetController.php @@ -145,7 +145,7 @@ public function storeFromUrl(StoreAssetFromUrlRequest $request, UnsplashService $filename = Str::uuid().'.'.$extension; $path = 'medias/'.$filename; - Storage::put($path, $response->body()); + Storage::disk('public')->put($path, $response->body()); $meta = []; $tempFile = tempnam(sys_get_temp_dir(), 'unsplash'); From c7309627abf297f2870e943d84046f4989d643d1 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 16:18:50 +0200 Subject: [PATCH 05/11] Refactor account deletion condition in ProfileController --- app/Http/Controllers/App/Settings/ProfileController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index 0d7273be..69d6a3d6 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -126,8 +126,8 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse $user->workspaces()->detach(); - if ($account) { - $account->delete(); + if ($account && $user->isAccountOwner()) { + $account->delete(); } }); From 16d69e433841c23a945b8f2aa3039d0408ac70f1 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 16:37:05 +0200 Subject: [PATCH 06/11] Refactor storage method for asset uploads --- app/Http/Controllers/App/AssetController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/App/AssetController.php b/app/Http/Controllers/App/AssetController.php index 0a89a4fb..eab0588d 100644 --- a/app/Http/Controllers/App/AssetController.php +++ b/app/Http/Controllers/App/AssetController.php @@ -145,7 +145,7 @@ public function storeFromUrl(StoreAssetFromUrlRequest $request, UnsplashService $filename = Str::uuid().'.'.$extension; $path = 'medias/'.$filename; - Storage::disk('public')->put($path, $response->body()); + Storage::put($path, $response->body()); $meta = []; $tempFile = tempnam(sys_get_temp_dir(), 'unsplash'); From 7765640fdd736b66a976aa539058f13d4afca922 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 16:41:40 +0200 Subject: [PATCH 07/11] Refactor media storage method to use default disk --- app/Models/Traits/HasMedia.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Traits/HasMedia.php b/app/Models/Traits/HasMedia.php index 7fbb8590..5b9f1f52 100644 --- a/app/Models/Traits/HasMedia.php +++ b/app/Models/Traits/HasMedia.php @@ -88,7 +88,7 @@ public function addMedia(UploadedFile $file, string $collection = 'default', arr $filename = Str::uuid().'.'.$normalizedExt; $path = 'medias/'.$filename; - Storage::disk('public')->put($path, $normalizedBytes); + Storage::put($path, $normalizedBytes); return $this->media()->create([ 'group_id' => $groupId ?? Str::uuid()->toString(), From 9bc46996e4de023bcf96b2c20fe5d990964c2008 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 16:42:25 +0200 Subject: [PATCH 08/11] Refactor storage method for media upload --- app/Models/Traits/HasMedia.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Traits/HasMedia.php b/app/Models/Traits/HasMedia.php index 5b9f1f52..c1b9cb5e 100644 --- a/app/Models/Traits/HasMedia.php +++ b/app/Models/Traits/HasMedia.php @@ -126,7 +126,7 @@ public function addMediaFromPath(string $filePath, string $originalFilename, str $filename = Str::uuid().'.'.$normalizedExt; $storagePath = 'medias/'.$filename; - Storage::disk('public')->put($storagePath, $normalizedBytes); + Storage::put($storagePath, $normalizedBytes); return $this->media()->create([ 'group_id' => $groupId ?? Str::uuid()->toString(), From 94d64c989b6293c9f96cd820a5316fa8198e8887 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 17:19:37 +0200 Subject: [PATCH 09/11] Simplify account deletion condition in ProfileController --- app/Http/Controllers/App/Settings/ProfileController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index 69d6a3d6..0af891a1 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -126,7 +126,7 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse $user->workspaces()->detach(); - if ($account && $user->isAccountOwner()) { + if ($account) { $account->delete(); } }); From b76d3b64a7adfc375209a37db400e069c5c94058 Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 17:20:03 +0200 Subject: [PATCH 10/11] Fix formatting issue in ProfileController.php --- app/Http/Controllers/App/Settings/ProfileController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index 0af891a1..c555930c 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -101,7 +101,7 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse } if ($account) { - $account->subscriptions()->delete(); + $account->subscriptions()->delete(); } $ownedWorkspaces = Workspace::where('user_id', $user->id)->get(); From 5e3f1676c9eff5ccda94cc830690a95732ec531c Mon Sep 17 00:00:00 2001 From: Sebastian Albert <60854302+albertvisuals@users.noreply.github.com> Date: Tue, 19 May 2026 17:25:19 +0200 Subject: [PATCH 11/11] Fix indentation in ProfileController.php --- app/Http/Controllers/App/Settings/ProfileController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/App/Settings/ProfileController.php b/app/Http/Controllers/App/Settings/ProfileController.php index c555930c..0d7273be 100644 --- a/app/Http/Controllers/App/Settings/ProfileController.php +++ b/app/Http/Controllers/App/Settings/ProfileController.php @@ -101,7 +101,7 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse } if ($account) { - $account->subscriptions()->delete(); + $account->subscriptions()->delete(); } $ownedWorkspaces = Workspace::where('user_id', $user->id)->get(); @@ -127,7 +127,7 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse $user->workspaces()->detach(); if ($account) { - $account->delete(); + $account->delete(); } });