예제 #1
0
 /**
  * Assign the role to the users with the given ids.
  *
  * @param  \JonaGoldman\Bouncer\Database\Role  $role
  * @param  array  $ids
  * @return void
  */
 protected function assignRole(Role $role, array $ids)
 {
     $existing = $role->users()->whereIn('id', $ids)->lists('id')->all();
     $ids = array_diff($ids, $existing);
     $role->users()->attach($ids);
 }