1
2//mysql query be like this
3// ... WHERE (gender = 'Male' and age >= 18) or (gender = 'Female' and age >= 65)
4
5//Eloquent query is
6// ...
7$q->where(function ($query) {
8 $query->where('gender', 'Male')
9 ->where('age', '>=', 18);
10})->orWhere(function($query) {
11 $query->where('gender', 'Female')
12 ->where('age', '>=', 65);
13})
14//@sujay