Beispiel #1
0
 /**
  * Attach Roles to a User.
  *
  * @param $user
  * @param $roleIds
  */
 public function addRoles($user, $roleIds)
 {
     foreach ($roleIds as $id => $value) {
         $role = $this->roleRepository->findById($id);
         $user->attachRole($role);
     }
 }