From e5554132954e76251ea4f362f945ac5e3f348a30 Mon Sep 17 00:00:00 2001 From: Nyan Lin Paing <117423022+LinPaing21@users.noreply.github.com> Date: Thu, 3 Sep 2026 00:45:19 +0700 Subject: [PATCH] Fix EV company logo not rendering in Filament table ImageColumn::make('logo') had no explicit disk, so it defaulted to Filament's local disk while uploads write to the public disk, causing the file-existence check to fail and the src to render empty. Align the column's disk with the upload field's disk. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_015HaT8a5ZWh45JkjTLPWeaP --- .../EvCompanies/Tables/EvCompaniesTable.php | 1 + .../catalog/tests/Feature/EvCompanyResourceTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app-modules/catalog/src/Filament/Resources/EvCompanies/Tables/EvCompaniesTable.php b/app-modules/catalog/src/Filament/Resources/EvCompanies/Tables/EvCompaniesTable.php index d46686a..b2761e0 100644 --- a/app-modules/catalog/src/Filament/Resources/EvCompanies/Tables/EvCompaniesTable.php +++ b/app-modules/catalog/src/Filament/Resources/EvCompanies/Tables/EvCompaniesTable.php @@ -18,6 +18,7 @@ class EvCompaniesTable return $table ->columns([ ImageColumn::make('logo') + ->disk('public') ->circular(), TextColumn::make('name') ->searchable() diff --git a/app-modules/catalog/tests/Feature/EvCompanyResourceTest.php b/app-modules/catalog/tests/Feature/EvCompanyResourceTest.php index ebe480a..6af9b4e 100644 --- a/app-modules/catalog/tests/Feature/EvCompanyResourceTest.php +++ b/app-modules/catalog/tests/Feature/EvCompanyResourceTest.php @@ -1,6 +1,7 @@ assertCanSeeTableRecords($companies); }); +test('renders the logo from the public disk in the table', function () { + Storage::fake('public'); + Storage::disk('public')->put('logos/example.png', 'fake-image-contents'); + + $company = EvCompany::factory()->create(['logo' => 'logos/example.png']); + + Livewire::test(ListEvCompanies::class) + ->assertOk() + ->assertSee(Storage::disk('public')->url($company->logo), escape: false); +}); + test('can create an ev company', function () { $company = EvCompany::factory()->make();