You need to nest a function each time you want some brackets in your query, like this (untested)...
$query
->where(function($startQuery) {
$startQuery
->where(function($thisYearQuery) {
$thisYearQuery
->where('date_start_month', '<', 5)
->where('date_start_year', 2015);
})
->orWhere('date_start_year', '<', 2015);
})
->where('date_end_month', 5)
->where('date_end_year', 2015);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community