Change the option title in a SelectFilter relationship

I have a simple table filter like this:

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>
Solution
Hi @ericlbarnes, I think the SelectFilter also supports 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
Was this page helpful?