© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
Sesh

Select filter grouping options in relation filter

I am struggling to get a Select filter on a relation working with option groups described here: https://filamentphp.com/docs/3.x/forms/fields/select#grouping-options

This is my Select field in the table filters:

SelectFilter::make('trends')
     ->label(__('Trends'))
     ->searchable()
     ->options($formattedData)
     ->preload(),
SelectFilter::make('trends')
     ->label(__('Trends'))
     ->searchable()
     ->options($formattedData)
     ->preload(),


The format of the options is right and they get displayed correctly with the groups, butwhen i select an entry, I get this error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'trends' in 'where clause'
SELECT
  count(*) AS aggregate
FROM
  `news`
WHERE
  (`trends` = 1)
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'trends' in 'where clause'
SELECT
  count(*) AS aggregate
FROM
  `news`
WHERE
  (`trends` = 1)


How can I configure the select so its checking the relation. When I use ->relation() it takes the options from the relation and not from the customized option array. Thanks.
Select - Form Builder - Filament
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

Select Filter with relation
FilamentFFilament / ❓┊help
3y ago
Group Options in record Select in Relation Manager
FilamentFFilament / ❓┊help
17mo ago
Select Filter with nested relation won't filter
FilamentFFilament / ❓┊help
2y ago
Select filter attribute name by relation
FilamentFFilament / ❓┊help
12mo ago