Laravel Spatie Asigne Rôle
$role->givePermissionTo($permission);
$permission->assignRole($role);
Mohamad
$role->givePermissionTo($permission);
$permission->assignRole($role);
// Create a role or permission if necessary
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
$role = Role::create(['name' => 'writer']);
$permission = Permission::create(['name' => 'edit articles']);