Answers for "spatie give permissionto and assign role"

0

spatie give permissionto and assign role

// Adding permissions to a user
$user->givePermissionTo('edit articles');

// Adding permissions via a role
$user->assignRole('writer');

$role->givePermissionTo('edit articles');
Posted by: Guest on October-28-2021

Browse Popular Code Answers by Language