How to permanently filter table
I think my question is quite simple:
I have a table
invoices
that I'll link to a resource. but I want to filter the table so that the currently authenticated user can only see/edit/create invoices that are associated with him.
So this is not a filter that the user can control8 Replies
Solution
Use the ->query() method on the $table instance. Here’s an example:
any idea what's the difference between
->query
and ->modifyQueryUsing
that's in the docs?I actually didn’t dive into this; I found the method in the source of the Table class.
sounds good, thanks for the help!
👍
They both do the same thing, but the core team has been moving more towards the
using
pattern. Here’s some discussion:
https://github.com/filamentphp/filament/pull/9293#issuecomment-1781417555GitHub
New table filters indicator API by zepfietje · Pull Request #9293 ·...
Changes have been thoroughly tested to not break existing functionality.
New functionality has been documented or existing documentation has been updated to reflect changes.
Visual changes are ex...
👍