Filter above custom page HasTable

How can I place filters above the table on a custom page? I tried these two but it doesn't work:
use Filament\Tables\Enums\FiltersLayout;

protected function getTableFiltersLayout(): FiltersLayout
{
return FiltersLayout::AboveContent;
}
use Filament\Tables\Enums\FiltersLayout;

protected function getTableFiltersLayout(): FiltersLayout
{
return FiltersLayout::AboveContent;
}
and
protected function getFiltersLayout(): FiltersLayout
{
return FiltersLayout::AboveContentCollapsible;
}
protected function getFiltersLayout(): FiltersLayout
{
return FiltersLayout::AboveContentCollapsible;
}
Solution:
Is this still v2? Or did you just not update the syntax?
Jump to solution
7 Replies
DrByte
DrByte9mo ago
Does it work if you simply set the filter position directly on your $table definition? https://filamentphp.com/docs/3.x/tables/filters#displaying-filters-below-the-table-content
H.Bilbao
H.Bilbao9mo ago
I just tried it on a resource table and it doesn't work
Dennis Koch
Dennis Koch9mo ago
Can you share the code you used?
H.Bilbao
H.Bilbao9mo ago
Gist
Filter above custom page HasTable
Filter above custom page HasTable. GitHub Gist: instantly share code, notes, and snippets.
Solution
Dennis Koch
Dennis Koch9mo ago
Is this still v2? Or did you just not update the syntax?
H.Bilbao
H.Bilbao9mo ago
It is v3, I will check if it is a syntax issue After update the syntax is ok the filter, thanks