Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

peterhrobar's avatar

Get active filters for table

How can i get the current table query - with the active filters - in the getTabs() method of a resource list page?

I can call self::$resource::getEloquentQuery() but it obviously does not reflect the active filters on the table.

Would be nice to reflect the filter so the tab badge will show the right count for each tab even when the table is filtered ... tried self::$resource::getTable() etc. but these are not available methods in this context

0 likes
2 replies
peterhrobar's avatar

standard Filament code. No need honestly to paste it here ....

Anyway, same question ... :-)

public function getTabs(): array
{
     $tabs = [
        'all' => Tab::make('All')->badge(
             $this->getModel()::count()
        ),
     ];
	....
1 like

Please or to participate in this conversation.