//Single
$user->roles()->sync([1,2,3]);
//With attributes
$user->roles()->sync([
1 => ['expires' => true],
2 => ['expires' => false],
...
]);
$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)));