Example #1
0
 public function hasLikedPosts(Posts $posts)
 {
     return (bool) $posts->likes()->where('likeable_id', $posts->id)->where('likeable_type', get_class($posts))->where('user_id', $this->id)->count();
 }