From 780f351ee68813252ec531b570bee1262fc16047 Mon Sep 17 00:00:00 2001 From: Sander van Hooft Date: Mon, 2 Feb 2026 18:56:43 +0000 Subject: [PATCH] Fix duplicate getUploadedFileNameForStorageUsing callbacks in Colors.php Both the logo and favicon FileUpload fields had two getUploadedFileNameForStorageUsing callbacks. The second callback overrides the first (PHP method chaining), causing: - Logo: stored with an absolute server path (storage_path(...)) instead of 'logo-{name}' - Favicon: the correct callback was second, but the first (broken) one was redundant This removes the duplicate callbacks, keeping only the correct ones: - Logo: 'logo-{originalname}' - Favicon: 'favicon.png' --- app/Filament/Pages/Colors.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/Filament/Pages/Colors.php b/app/Filament/Pages/Colors.php index 98f1b640..72079db2 100644 --- a/app/Filament/Pages/Colors.php +++ b/app/Filament/Pages/Colors.php @@ -69,11 +69,6 @@ public function form(Schema $schema): Schema function (TemporaryUploadedFile $file): string { return (string)str($file->getClientOriginalName())->prepend('logo-'); } - ) - ->getUploadedFileNameForStorageUsing( - function ($record) { - return storage_path('app/public/' . app(ColorSettings::class)->logo); - } ), FileUpload::make('favicon') ->label(trans('theme.favicon')) @@ -82,11 +77,6 @@ function ($record) { // ->imageResizeTargetHeight('64') // ->imageResizeTargetWidth('64') ->maxSize(1024) - ->getUploadedFileNameForStorageUsing( - function ($record) { - return storage_path('app/public/favicon.png'); - } - ) ->getUploadedFileNameForStorageUsing( function (TemporaryUploadedFile $file): string { return (string)'favicon.png';