FilamentF
Filament7mo ago
EDZero

[Filament v4] Filtering TableSelect with Tabs

Hi all 👋

I’m using Filament v4 and I’d like to display tabs above a TableSelect field to filter the selectable records. The goal is to let users click a tab (e.g. event category) and have the TableSelect update its query accordingly.

Here is what I have done so far:
Step::make('Choose Template')
    ->schema([
        TableSelect::make('template_id')
            ->relationship('template', 'id')
            ->hiddenLabel()
            ->tableConfiguration(TemplatesTable::class)
    ]),


I’ve tried using ->aboveContent() to show the tabs, but I’m not sure how to connect the selected tab to the query inside the TableSelect's tableConfiguration.

Is there a correct way to:

  1. Add tabs above a TableSelect, and
  2. Use the selected tab value to filter the query (in getTableQuery() or similar)?
Any guidance or examples would be appreciated! Thanks 🙏
Was this page helpful?