SelectFilter show full name
I currently have this filter added in:
SelectFilter::make('agent_id')->label('Agent')->relationship('filamentUser', 'first_name')
It only shows me first_name
values.
I need to show both first_name
and last_name
. How can I achieve this?10 Replies
you can use
->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->first_name} {$record->last_name}")
Just tried using it, but there is no definition found.
not sure when this introduced! maybe update filament to last version
Hmm intresting, what version are you using?
you are in a table definition right?
Version ...................................... v3.1.18
use Filament\Tables\Filters\SelectFilter;
Ah this might explain it
ooh you in version 2 π
hope it's supported, I dont remember
I am currently upgrading now π
Bit of a paint to upgrade not gonna lie lol
lol
it depends on your app, but the upgrade script helps a lot
Kinda new to filament at the moment. Just took over someone else's project lol