dimanche 5 janvier 2020

Laravel Roles and Permission attach data store in model_has_permissions

I'm using Spatie/Laravel Permissions

When I attached permissions to the roles it stores in roles_has_permissions table, I want to store the data in model_has_permission table instead of roles_has_permissions.

$role = Role::find(1);
$role->syncPermissions([1,2]);

is there a way to do it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire