/** * User update form * * @param $id * @return View */ public function edit($id) { try { // @TODO Move this part to a sparate command $user = $this->userRepo->getUserWithRoles($id); $roles = $this->roleRepo->getAll(); $userRoles = $user->roles->lists('id'); $userCategories = $this->catRepo->getUserCategories($user)->lists('id'); $categories = $this->catRepo->getAll(); return $this->view('salgado.pages.user.create_edit', compact('user', 'roles', 'userRoles', 'userCategories', 'categories')); } catch (NotFoundException $e) { App::abort(404); } }