From 23df360b60e3582e04259b5383db26cbc5def393 Mon Sep 17 00:00:00 2001 From: Kyrch Date: Thu, 26 Mar 2026 13:24:09 -0300 Subject: [PATCH] fix(filament): fix option label when model doesnt use scout (#1142) --- app/Filament/Components/Fields/Select.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Filament/Components/Fields/Select.php b/app/Filament/Components/Fields/Select.php index eda82bcb5..740f028a9 100644 --- a/app/Filament/Components/Fields/Select.php +++ b/app/Filament/Components/Fields/Select.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Filament\Components\Fields; +use App\Contracts\Models\Nameable; use App\Filament\RelationManagers\BaseRelationManager; use App\Search\Criteria; use App\Search\Search; @@ -48,7 +49,8 @@ class Select extends ComponentsSelect ); } - return $this->searchable(); + return $this->searchable() + ->getOptionLabelUsing(fn (Model&Nameable $record) => $record->getName()); } public function escapeReservedChars(string $search): string