Beispiel #1
0
 /**
  * Show a user's info.
  *
  * @param  int $userId
  *
  * @return \Illuminate\View\View
  */
 public function show($userId)
 {
     if (!($user = $this->users->findByKey($userId))) {
         return $this->notFound();
     }
     $canEdit = $this->users->hasPermission($user);
     $view = $this->view('c::user.show', ['user' => $user, 'backUrl' => URL::to('/'), 'canEdit' => $canEdit]);
     if ($canEdit) {
         $view->with(['editUrl' => $this->url('edit', [$userId])]);
     }
     return $view;
 }