Okkult
63
0
Mix

Handle specific Create/Read/Update permissions with Spatie

Posted 1 month ago by Okkult

Hello, I'm trying to use the following view for updating a certain user or role's permissions in my web application:

https://imgur.com/fmk1vWy

Until now, all permissions that exist on the project follow the pattern of 'create [module]'-'read [module]'-'update [module]' so having each permission listed isn't really the best approach. I don't want to abuse scripts on the front-end nor do I want to overflow the Permissions model or database access each time a person modifies a user or role's permissions. I came to the conclusion of having sort of the following tables:

https://imgur.com/VdBnA7n

but that wouldn't work with Spatie Permissions model which is of course as important. My question is, which Laravel class or methods should I make or modify in order to support this front-end view for updating permissions and still have everything lightweight and practical?

Please sign in or create an account to participate in this conversation.