© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
Rome

Format state of select filter

I have a select filter with a relationship:
SelectFilter::make('employee')->relationship('employee', 'name')
SelectFilter::make('employee')->relationship('employee', 'name')
. I need to modify de label of each option to show ID + name instead of the name only.
formatStateUsing()
formatStateUsing()
is not available here.
Solution
->getOptionLabelFromRecordUsing(fn (Employee $record) => "{$record->id} {$record->name}")
->getOptionLabelFromRecordUsing(fn (Employee $record) => "{$record->id} {$record->name}")
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

State of Select Relationship
FilamentFFilament / ❓┊help
3y ago
format state of select input field using multiple data from other models
FilamentFFilament / ❓┊help
3y ago
get filter state
FilamentFFilament / ❓┊help
3y ago
dependent select filter
FilamentFFilament / ❓┊help
2y ago