Skip to content
Discussion options

You must be logged in to vote

I think you just want to chain the two wheres, since there's no or involved.

// using has
$query->where('is_private', true)->has('classrooms');
// using whereHas
$query->where('is_private', true)->whereHas('classrooms', function ($deptQuery) {
      $deptQuery->where('course_id', $course->id);
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fzn0x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants