FilamentF
Filament3y ago
dyo

Set filter form column in relation manager

Can anyone tell me what should i do to set filter form column in relation manager?

I want to have 3 grid of columns at filter forms, using filament v2..
Solution
Ok, then do like this
return $table
    ...
    ->filters([
        Filter::make('created_at')
            ->form([
                Grid::make(3)
                    ->schema([
                        Forms\Components\DatePicker::make('created_from'),
                        Forms\Components\DatePicker::make('created_until'),
                        Forms\Components\DatePicker::make('updated_at'),
                    ]),
            ])
            ->columnSpan('full'),
    ])
    ...

// use filter layout like below
protected function getTableFiltersLayout(): ?string
{
    return Layout::AboveContent;
}

Ref: https://filamentphp.com/docs/2.x/tables/filters#displaying-filters-above-or-below-the-table-content
Was this page helpful?