Laravel -Modellsynchronisation
$user->roles()->sync([1, 2, 3]);
Fahim Foysal
$user->roles()->sync([1, 2, 3]);
$user = User::find(1);
$user->roles()->detach([1, 2, 3]);
$user->roles()->attach([
1 => ['expires' => $expires],
2 => ['expires' => $expires],
]);
$user->roles()->sync(array(1 => array('expires' => true)));