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

Laravel – How can I post array of objects like example

I have a problem with calling an API with Laravel. I wont to call an api with a request like this (this is an example of json request): { "costCenterCode":"CDC-00070964", "paperless":"false", "shipmentDate":"2020-11-26T08:02:20.986+0000", "waybills":[ { "clientReferenceId":"12312312341", "printFormat":"A4", "product":"APT000901", "data":{ "declared":[ {…

VIEW QUESTION

Laravel API URL not found

I am creating an API Laravel project and it seems that there an error I can't find. I want to get data from the table 'units'. These are the codes: bootstrap/app.php <?php use IlluminateFoundationApplication; use IlluminateFoundationConfigurationExceptions; use IlluminateFoundationConfigurationMiddleware; return Application::configure(basePath:…

VIEW QUESTION
Back To Top
Search