public function show($id)
 {
     $user = User::findOrFail($id);
     if (\Auth::guest() && $user->profile_private) {
         return \Response::make('', 404);
     }
     $profileData = $this->profileRepo->getUserProfile($id);
     $userSkills = array_intersect_ukey($this->profileSkillsRepository->getAll(), array_flip($profileData->skills), [$this, 'key_compare_func']);
     return \View::make('members.show')->with('user', $user)->with('profileData', $profileData)->with('userSkills', $userSkills);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param $roleId
  * @param $userId
  * @return Response
  */
 public function destroy($roleId, $userId)
 {
     $role = Role::findOrFail($roleId);
     //don't let people remove the admin permission if they are a trustee
     $user = User::findOrFail($userId);
     if ($user->active && $user->director && $role->name == 'admin') {
         \Notification::error("You cannot remove a trustee from the admin group");
         return \Redirect::back();
     }
     $role->users()->detach($userId);
     return \Redirect::back();
 }
Example #3
0
 public function inductedBy()
 {
     return User::findOrFail($this->inducted_by);
 }
 public function getInactiveKeyholderMember()
 {
     return User::findOrFail(2);
 }