How to get the filters currently in use on a rendered table.
I'm trying to conditionally make actions visible based on the currently active filter on my table. This is in a livewire component with a filament table.
I can't sort out how to determine if the only_trashed filter is active. I want to show the restore button and hide the deleted button, and vice versa, but am struggling with building the conditions for visible() on the action. I can find functions to determine the available filter options, but not the actual active filter.
2 Replies
Bump? sorry if i'm missing something stupidly obvious....
Why not do it based on the record values?
It would be:
->visible(fn() => !is_null($record->deleted_at))
to show if the deleted_at column is not null which means it has been deleted