I have a courses table I want to query like this :
$semesters = [5,3,7];
$class_id = 3;
Course::where(['class_id' => $class_id, 'semester_id' => $semesters ])->get();
where $semesters must be an array. so I want to get the collection of courses where class_id is 3 and where semester_id is 5,3,7. however it gets the collection of only the first index of the $semester array. how do I get the collection of all the values of that $semester array?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire