-3

I am using Laravel spatie package. I want to create a permission module for each controller and each controller has create, read, update and delete. Foe example, I have product controller and I don't want to create permission for that controller like => "create_product", "read_product", "update_product" and "delete_product". What I want is I want to name the permission as product and sub permission for that with create, read, update and delete in same column. Please share me some solution how can I achieve this. Thanks in advance!

1 Answers1

0

What I use in laravel is the policies. Each model has its Policy with the create(), update(), destroy(), ... and other functions. You can add your own logic in these functions.

You can check the documentation for more details: laravel-official-documentation