Ability to pre-filter Relation Manager table results
I have a bunch of records with various statuses, I'd like to omit Cancelled when the user loads the page, but allow it as a filtered option.
I have a
SelectFilter
with multiple options, I saw that I could enable default on a toggle or something like that but don't think it works on a select.
I also tried to use getTableQuery
but the filters are unable to overwrite the results.3 Replies
Did you chain off of the parent::getTableQuery()
->default()
should work on SelectFilter
. Please share your codeSorry, busy week!
I have a lesson with a pivot SwimmerLesson that has a relation to Swimmers
My Resource is a Lesson and the Relation is a Swimmer.
The status is on the SwimmerLesson so the pivot.
I have a filter that works when I don't change the table query.
But I did add
->default('active)
to the filter and that did the trick.
Actually, is it possible to have multiple defaults?
I have a bunch of statuses, and I mainly want to exclude Cancelled on load.
got it