Level 1
maybe whereBetween('data_field', [$from, $to])->get(); $from, $to is like date('yyy-mm-dd')
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have entity Authorization with start and end attributes. How to find specific authorization with given date that is between start and end but last authorization don't need to have end (it's not required). In that case I need between start and now. How to do that?
Something like this
Auth::where('start', '>=', $start)->where(function ($q) {
$q->where('end', '<', $end)->orWhereNull('end');
})->get();
Please or to participate in this conversation.