Trying to use and/or where statements as if they were nested in parentheses. example:
Select * from myTable
where
(id > 78 or name is not null)
and term_date >= NOW())
Trying to get these complex where statements to be used in Laravel Collections like so:
$query = myTableModel::where(['id', '>', 78])
->orWhereNotNull('name')
->where('term_date', '>=', date('Y-m-d'))
But this type of query would return a where like this
where
(id > 78 or
name is not null and
term_date >= Now())
or any other odd combination of where instead of setting up nested parentheses.
Is there a way to solve this type of issue using laravel Collections?