Example #1
0
 /**
  * Query the discussion's participants (a list of unique users who have
  * posted in the discussion).
  *
  * @return \Illuminate\Database\Eloquent\Builder
  */
 public function participants()
 {
     return User::join('posts', 'posts.user_id', '=', 'users.id')->where('posts.discussion_id', $this->id)->select('users.*')->distinct();
 }