Example #1
0
 /**
  * @param Request $request
  * @param string  $slug
  * @param int     $id
  *
  * @return \Illuminate\View\View
  */
 public function show(Request $request, $slug = '', $id = 0)
 {
     // Forum permissions are checked in "find"
     $topic = $this->topicRepository->find($id);
     if (!$topic) {
         throw new TopicNotFoundException();
     }
     $poll = null;
     if ($topic->has_poll) {
         $poll = $topic->poll;
     }
     $this->breadcrumbs->setCurrentRoute('topics.show', $topic);
     $this->topicRepository->incrementViewCount($topic);
     $posts = $this->postRepository->allForTopic($topic, true);
     $highlight = (int) $request->get('highlight');
     return view('topic.show', compact('topic', 'posts', 'poll', 'highlight'));
 }