getTabs in a widget - is that possible? How?

I have a Table Widget which displays some data. I want to get the active Filter to manage a query. I found https://filamentphp.com/docs/3.x/tables/filters#injecting-the-current-filter-instance but I don't know if this is what I need. How may I implement it correctly?
6 Replies
TheSoulrester
TheSoulresterβ€’2w ago
This is my widget. For now, $year = now()->year; sets the Filter hard to this year. But I want to get the active filter
TheSoulrester
TheSoulresterβ€’2w ago
Wow, I think Discord ate my opener text πŸ˜„ I found this: https://filamentphp.com/docs/3.x/tables/filters#injecting-the-current-filter-instance I want to get the active set filter and use it for the query to get the necessary query data
TegarJK
TegarJKβ€’2w ago
Filament Examples
Tabs Over the List Table
Some resources might have too much information to display. In that case - we can use Tabs to filter them out for our users. Also, did you know you can have count badges on tabs?
TheSoulrester
TheSoulresterβ€’2w ago
thank you I added
public function getTabs(): array
{
$tabs = [];

$tabs[] = Tab::make('2024');
$tabs[] = Tab::make('2023');

return $tabs;
}
public function getTabs(): array
{
$tabs = [];

$tabs[] = Tab::make('2024');
$tabs[] = Tab::make('2023');

return $tabs;
}
without any query and removed the filter to test if Tabs are shown up but they don't 😦
TheSoulrester
TheSoulresterβ€’2w ago
Ok, I found out that I have to implement the getTabs() in the ListResource But my widget doesnt have a ListResource. The widget is shown at the dashboard. How to solve this?
Want results from more Discord servers?
Add your server