Пример #1
0
 /**
  * @param $postIds
  * @param User $actor
  * @return mixed
  */
 protected function getDiscussionsForPosts($postIds, User $actor)
 {
     return Discussion::query()->select('discussions.*')->join('posts', 'posts.discussion_id', '=', 'discussions.id')->whereIn('posts.id', $postIds)->groupBy('discussions.id')->whereVisibleTo($actor)->get();
 }
Пример #2
0
 /**
  * Get a new query builder for the discussions table.
  *
  * @return Builder
  */
 public function query()
 {
     return Discussion::query();
 }