Exemplo n.º 1
0
 /**
  * @return the selected post
  * @param $id
  * @param string $slug
  */
 public function showPost($id, $slug = '')
 {
     $post = Post::published($id)->first();
     $comments = Comment::commentPublished($post->id)->get();
     return view('front.single', compact('post', 'comments'));
 }
Exemplo n.º 2
0
 /**
  * Coount all comments published
  * @return mixed
  */
 public function countCommentsPublished()
 {
     $countComments = Comment::commentPublished($this->id)->get()->count();
     return $countComments;
 }