Limiting Filament Table to User-Accessible in resource
Hello! How are you? I have a resource called SchoolResource for my School model. But I need only the schools that the user has permission to view to appear in the resource table. I already have a very simple method that does this, but I don't know how to limit the filament table.
Solution:Jump to solution
in the resource override the query and add a scope or a where:
```php
public static function getEloquentQuery(): Builder
{...
5 Replies
Your code isn't from a resource but looks like from a custom page
It is indeed from a resource, I abstracted the code.
Solution
in the resource override the query and add a scope or a where:
What's with the mount then?
I got it with this