Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lukebouch's avatar

Scope Roles to certain models using my pivot table

I need to be able to scope certain permissions to certain models and then be able to check authorization of a user based on that model. I have a pivot table called userables that stores the different models a user has joined. I would like to add a column of role . Do you have any ideas of how to extend Laravel’s authorization system and Spatie Permissions to allow me to check permissions based on the role the user has in the pivot table? Or is there a better package to use like Bouncer?

0 likes
0 replies

Please or to participate in this conversation.