Actualizar spatie de rol

// All current roles will be removed from the user and replaced by the array given
$user->syncRoles(['writer', 'admin']);
Lokesh003