© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
ericlbarnes

Change the option title in a SelectFilter relationship

I have a simple table filter like this:

SelectFilter::make('group')
    ->relationship('group', 'name'),
SelectFilter::make('group')
    ->relationship('group', 'name'),

https://filamentphp.com/docs/3.x/tables/filters#relationship-select-filters

I don't see it outlined in the docs, but is it possible to change the way the options are generated? For example, it shows the name, but I'd like it to be:

<option value="">{{ $id }} - {{ $name }}</option>
<option value="">{{ $id }} - {{ $name }}</option>
Filters - Table Builder - Filament
Solution
Hi @ericlbarnes, I think the SelectFilter also supports
getOptionLabelFromRecordUsing()
getOptionLabelFromRecordUsing()
like a basic Select field:
https://filamentphp.com/docs/3.x/forms/fields/checkbox-list#customizing-the-relationship-option-labels
https://filamentphp.com/docs/3.x/forms/fields/select#customizing-the-relationship-option-labels
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

How to customise title in SelectFilter loaded via relationship?
FilamentFFilament / ❓┊help
3y ago
SelectFilter relationship field
FilamentFFilament / ❓┊help
3y ago
SelectFilter with relationship help...
FilamentFFilament / ❓┊help
2y ago
SelectFilter with relationship query
FilamentFFilament / ❓┊help
2y ago