How to access filter data from a widget?

I have a widget defined in GetHeaderWidgets on the List page of my resource

I have a date filter defined in my
table
function

I want to pass the current filter data (startDate and endDate) to the widget
Solution
Inside that widget class you have to use InteractsWithPageTable:
use Filament\Widgets\Concerns\InteractsWithPageTable;

class WidgetName extends StatsOverviewWidget
use InteractsWithPageTable;
...


and then you can get the filters with
$this->tableFilters

Edit: I'm using Filament v4, so not sure if it's the same as in v3
Was this page helpful?