How can I access custom page's filters at the custom widget?
I have added "use HasFiltersAction;" and a header filter action at the custom page:
FilterAction::make()
->form([
DatePicker::make('start_date'),
DatePicker::make('end_date'),
]),
I have also added the "use InteractsWithPageFilters;" at the custom Table Widget.
Filters are shown but even when I apply filters, $this->fiilters is always null in the widget class.
FilterAction::make()
->form([
DatePicker::make('start_date'),
DatePicker::make('end_date'),
]),
I have also added the "use InteractsWithPageFilters;" at the custom Table Widget.
Filters are shown but even when I apply filters, $this->fiilters is always null in the widget class.
Solution
public function getWidgetData(): array
{
return [
'filters' => $this->filters,
'record' => $this->getRecord(),
];
}
{
return [
'filters' => $this->filters,
'record' => $this->getRecord(),
];
}