예제 #1
0
 /**
  * Show the single trick page.
  *
  * @param string $slug
  *
  * @return \Response
  */
 public function getShow($slug = null)
 {
     if (is_null($slug)) {
         return $this->redirectRoute('home');
     }
     $trick = $this->tricks->findBySlug($slug);
     if (is_null($trick)) {
         return $this->redirectRoute('home');
     }
     Event::fire('trick.view', $trick);
     $next = $this->tricks->findNextTrick($trick);
     $prev = $this->tricks->findPreviousTrick($trick);
     $this->view('tricks.single', compact('trick', 'next', 'prev'));
 }