I want to show restaurants which are currently open. How do I say in laravel:
WHERE (open = '00:00:00' and close = '00:00:00' ) OR (open < $currentTime and close > $currentTime)
I write it like this:
->where(function ($query) {
$query->where('owh.open', '=', '00:00:00')
->whereAnd('owh.close', '=', '00:00:00');
})->orWhere(function ($query) use ($currentTime) {
$query->where('owh.open', '<', $currentTime)
->whereAnd('owh.close', '>', $currentTime);
})
but it doesnt give me correct data.