I tried advanced where clauses
i have model with 2 datetime columns start
and end
the request comes two values date_start, date_end
my code
->where(function($q) use ($date_start,$date_end) {
$q->where('start','>=',$date_start)
->where('end','<=',$date_start)
->where('start','>=',$date_end)
->where('end','<=',$date_end);
})
->first();
code returned nothing but in table have one record, values on request suitable. What is wrong?
worked