/** * @return \Illuminate\Database\Eloquent\Model|null */ public function currentCategory() { // We don't want to go through anything if there's no category if (!Input::has('category') || !Input::get('category')) { return null; } $alias = Input::get('category'); $section = $this->sections->findByAlias($alias); // Cache the current section so that whenever someone asks for it we return // it right away without requesting it again. $this->setCurrentCategory($section); return $this->getCurrentCategory(); }
/** * Display the specified resource. * * @param string $alias * @return Response */ public function show($alias) { return $this->sections->findByAlias($alias); }