How to scope filament-shield roles
Hello,
I'm wondering how to scope the roles of bezhanSalleh/filament-shield so that the Admin role can only be selected by admins.
Here is my current code:
Thanks!
2 Replies
take a look at https://filamentphp.com/docs/4.x/forms/select#customizing-the-relationship-query
and try something like this
Thanks. Yes I would do that if I do not find any other solution. But I would really appreciate a cleaner way with scope.
+ Could you confirm that this solution also prevent user from forcing the admin role? (in backend)