Exemplo n.º 1
0
 public function show($slug)
 {
     $service = new PostService();
     $post = $service->getPost($slug);
     if (!$post) {
         abort(404);
     }
     $comments = $service->getComments($post['id']);
     $group = $service->getGroup($post['group_id']);
     if ($group != false) {
         $group['posts'] = $service->getPosts(null, $group['id']);
     }
     return view('blog.show', compact('post', 'comments', 'group'));
 }