update role spatie 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']);