I'm new to laravel. Here is my query that filters out the quizes that don't have any problem (questions) or the problems don't have any answers. but I'm not sure how to write it properly using laravel query builder. Considering I'm using eloquent to build relationships Would be even better if I could get the same result using laravel eloquent.
SELECT DISTINCT q.id, q.content
FROM m_quiz q
RIGHT JOIN (SELECT DISTINCT p.quiz_id as id
FROM m_problem p
RIGHT JOIN m_answer_choice a
ON p.id = a.problem_id) problem
ON q.id = problem.id
ORDER BY q.id;