/** * @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')); }
/** * Coount all comments published * @return mixed */ public function countCommentsPublished() { $countComments = Comment::commentPublished($this->id)->get()->count(); return $countComments; }