spatie permission update role code example
Example: update role spatie
// All current roles will be removed from the user and replaced by the array given
$user->syncRoles(['writer', 'admin']);
// All current roles will be removed from the user and replaced by the array given
$user->syncRoles(['writer', 'admin']);