skip to Main Content

Php versions – Which method to use for Laravel Collection to find a Date between two DateTime

$period = new DatePeriod( new DateTime('2024-03-20 00:00:00'), new DateInterval('P1D'), new DateTime('2024-03-28 23:59:59') ); $suppliersInfo = OrderProduct::whereNotNull('brand') ->whereBetween('updated_at', [$startDate, $endDate ])->get(); $labels = []; foreach ($period as $date){ $labels[] = $date->format('d-m-Y'); $dateToSearch = $date->format('Y-m-d'); $orderCount = $suppliersInfo->where( 'updated_at' , $dateToSearch )…

VIEW QUESTION
Back To Top
Search