title: check if all elements of an array exists in a table in laravel
body: <p>I have <code>courses</code> and <code>student_courses</code> table. If a student completed a course I'm inserting a row in <code>student_courses</code> table with <code>student_id</code> and <code>course_id</code>. Now I have a scenario where I need to get all <code>student_ids</code> from <code>student_courses</code> table if a student completed certain numbers of courses. I am getting <code>course_ids</code> from another query as an array. Is there any way to make this query efficiently in laravel, because there is already 100k+ data in <code>student_courses</code> table?</p>