/** * Editing a category * * @param $id * @return View */ public function edit($id) { try { $category = $this->catRepo->findById($id); return $this->view('salgado.pages.category.create_edit', compact('category')); } catch (NotFoundException $e) { App::abort(404); } }
/** * @param $catId * @return bool */ public function userHasAccessToCategory($catId) { $userCats = $this->catRepo->getUserCategories($this->getUser())->lists('id'); return in_array($catId, $userCats); }