예제 #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'));
 }
예제 #2
0
파일: Post.php 프로젝트: AndryRana/ConfPHP
 /**
  * Coount all comments published
  * @return mixed
  */
 public function countCommentsPublished()
 {
     $countComments = Comment::commentPublished($this->id)->get()->count();
     return $countComments;
 }