Closed
Description
I noticed a problem when I attempted to get the records between 2 dates, like this:
$month = new Carbon("first day of September");
self::where(function ($query) use ($month) {
$query->where('date', '>=', $month);
$query->where('date', '<=', $month->modify('last day of this month'));
// Also, the condition below returns a empty Collection object
//$query->whereBetween('date', [new Carbon("first day of September"), new Carbon("last day of September")]);
})->get();
It returns a empty Collection object, but if I comment any one of the $query
lines, it works fine.
I'm running it on Lumen.
Metadata
Metadata
Assignees
Labels
No labels