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.
Solution:
public function getWidgetData(): array { return [ 'filters' => $this->filters, 'record' => $this->getRecord(),...
Jump to solution
3 Replies
yannisc.
yannisc.OP11mo ago
I see that custom pages blade does not include "...(property_exists($this, 'filters') ? ['filters' => $this->filters] : []), ". That would be a good addition for next releases. For now, I added a getWidget function on the custom page with:
Solution
yannisc.
yannisc.11mo ago
public function getWidgetData(): array { return [ 'filters' => $this->filters, 'record' => $this->getRecord(), ]; }
yannisc.
yannisc.OP11mo ago
and it worked.
Want results from more Discord servers?
Add your server