{"id":"1754178078-0885-535784473","version":1,"type":"request","time":1754178077.739377,"method":"GET","url":"http:\/\/localhost\/dinex\/public\/api\/v1\/dashboard\/charts\/list?branches%5B0%5D=2&endDate=01-5-2025&period=custom&startDate=30-4-2025","uri":"\/dinex\/public\/api\/v1\/dashboard\/charts\/list?branches[]=2&period=custom&startDate=30-4-2025&endDate=01-5-2025","headers":{"authorization":["Bearer eyJpdiI6ImVVTHFEdlB5RkZuM3dONHZzU2Y2dXc9PSIsInZhbHVlIjoicE9ObXQ5aEVsUENjUk8zY2Z6NG1WcHdOQVk4OXkxS0ZXM3h0Yk1oa2NScHFVUWMxdG80WU8weEhDMGlwOGJyTiIsIm1hYyI6ImI2YjgwM2JlMDE4MjMzMmE3NzcyMzEwYTU1YzA4NzNiYzQyNzA3OGM3MDgzODZkZDVjNDVmMTJhZTcxZDJlYjMiLCJ0YWciOiIifQ=="],"accept":["application\/json"],"user-agent":["PostmanRuntime\/7.45.0"],"postman-token":["c40d72d1-953b-4ab8-933f-4d3bcfe6bee8"],"host":["localhost"],"accept-encoding":["gzip, deflate, br"],"connection":["keep-alive"],"cookie":["laravel_session=nThkl02Lqou1SZnZsTGbRamOoNhXaLHxyx2kydg8"]},"controller":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController@index","getData":{"branches":{"__type__":"array","0":"2"},"period":"custom","startDate":"30-4-2025","endDate":"01-5-2025"},"postData":[],"requestData":"","sessionData":{"_token":"YZm6RCuNUylb50ZlNanV9CCMuClpY5H2ahc4TkPS","_previous":{"__type__":"array","url":"http:\/\/localhost\/dinex\/public\/api\/v1\/dashboard\/charts\/list?branches%5B0%5D=2&endDate=01-5-2025&period=custom&startDate=30-4-2025"},"_flash":{"__type__":"array","old":{"__type__":"array"},"new":{"__type__":"array"}}},"authenticatedUser":null,"cookies":{"laravel_session":"nThkl02Lqou1SZnZsTGbRamOoNhXaLHxyx2kydg8"},"responseTime":1754178081.160531,"responseStatus":200,"responseDuration":3421.154022216797,"memoryUsage":25165824,"middleware":["api","auth.session","auth_api","api.role:admin|superadmin","api.role:superadmin|admin","api.permission:reports.read"],"databaseQueries":[{"query":"SELECT `id`, `name` FROM `payment_types`","duration":27.66,"connection":"mysql","time":1754178078.2913811,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Builder->get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":40,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->__construct()","file":null,"line":null,"isVendor":false},{"call":"ReflectionClass->newInstanceArgs()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":952,"isVendor":true},{"call":"Illuminate\\Container\\Container->build()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":795,"isVendor":true},{"call":"Illuminate\\Container\\Container->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php","line":986,"isVendor":true},{"call":"Illuminate\\Foundation\\Application->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":296,"isVendor":true},{"call":"Illuminate\\Container\\Container->Illuminate\\Container\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":908,"isVendor":true},{"call":"Illuminate\\Container\\Container->build()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":795,"isVendor":true},{"call":"Illuminate\\Container\\Container->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php","line":986,"isVendor":true},{"call":"Illuminate\\Foundation\\Application->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":731,"isVendor":true}],"model":"App\\Models\\PaymentType","tags":[]},{"query":"SELECT `id`, `name` FROM `branches`","duration":9.39,"connection":"mysql","time":1754178078.3238208,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Builder->get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":41,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->__construct()","file":null,"line":null,"isVendor":false},{"call":"ReflectionClass->newInstanceArgs()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":952,"isVendor":true},{"call":"Illuminate\\Container\\Container->build()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":795,"isVendor":true},{"call":"Illuminate\\Container\\Container->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php","line":986,"isVendor":true},{"call":"Illuminate\\Foundation\\Application->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":296,"isVendor":true},{"call":"Illuminate\\Container\\Container->Illuminate\\Container\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":908,"isVendor":true},{"call":"Illuminate\\Container\\Container->build()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":795,"isVendor":true},{"call":"Illuminate\\Container\\Container->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php","line":986,"isVendor":true},{"call":"Illuminate\\Foundation\\Application->resolve()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php","line":731,"isVendor":true}],"model":"App\\Models\\Branch","tags":[]},{"query":"SELECT * FROM `users` WHERE exists (SELECT * FROM `oauth_user_tokens` WHERE `users`.`id` = `oauth_user_tokens`.`user_id` and `id` = '7d6eb74e-adbf-466e-abab-ccc089c6fbb0' and `expire_date` > '2025-08-03 03:41:18') ORDER BY `created_at` DESC LIMIT 1","duration":26.26,"connection":"mysql","time":1754178078.404494,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Builder->first()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\AuthApiMiddleware.php","line":34,"isVendor":false},{"call":"App\\Http\\Middleware\\AuthApiMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php","line":50,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\AuthenticateSession.php","line":41,"isVendor":true},{"call":"Illuminate\\Session\\Middleware\\AuthenticateSession->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":159,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":125,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":87,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":"App\\Models\\User","tags":[]},{"query":"SELECT * FROM `branches` WHERE `branches`.`id` = 1 LIMIT 1","duration":1.63,"connection":"mysql","time":1754178078.432911,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Model->__get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\AuthApiMiddleware.php","line":41,"isVendor":false},{"call":"App\\Http\\Middleware\\AuthApiMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php","line":50,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\AuthenticateSession.php","line":41,"isVendor":true},{"call":"Illuminate\\Session\\Middleware\\AuthenticateSession->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":159,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":125,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":87,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":"App\\Models\\Branch","tags":[]},{"query":"SELECT `roles`.*, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` FROM `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` WHERE `model_has_roles`.`model_id` = 1 and `model_has_roles`.`model_type` = 'App\\\\Models\\\\User'","duration":7.3,"connection":"mysql","time":1754178078.4435592,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Model->__get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomRoleMiddleware.php","line":20,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomRoleMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\AuthApiMiddleware.php","line":43,"isVendor":false},{"call":"App\\Http\\Middleware\\AuthApiMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php","line":50,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\AuthenticateSession.php","line":41,"isVendor":true},{"call":"Illuminate\\Session\\Middleware\\AuthenticateSession->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":159,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\ThrottleRequests.php","line":125,"isVendor":true}],"model":"Spatie\\Permission\\Models\\Role","tags":[]},{"query":"SELECT `permissions`.*, `role_has_permissions`.`role_id` as `pivot_role_id`, `role_has_permissions`.`permission_id` as `pivot_permission_id` FROM `permissions` inner join `role_has_permissions` on `permissions`.`id` = `role_has_permissions`.`permission_id` WHERE `role_has_permissions`.`role_id` = 1","duration":8.86,"connection":"mysql","time":1754178078.455827,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Model->__get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":21,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomRoleMiddleware.php","line":21,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomRoleMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomRoleMiddleware.php","line":21,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomRoleMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\AuthApiMiddleware.php","line":43,"isVendor":false},{"call":"App\\Http\\Middleware\\AuthApiMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php","line":50,"isVendor":true},{"call":"Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":"Spatie\\Permission\\Models\\Permission","tags":[]},{"query":"SELECT COUNT(*) as total_orders, COUNT(CASE WHEN status = 3 THEN 1 END) as total_canceled_orders, COUNT(CASE WHEN status = 4 THEN 1 END) as total_returned_orders, COUNT(CASE WHEN status = 2 THEN 1 END) as total_delivered_orders, ROUND(SUM(price_before_discount) + SUM(vat) , 2) as total_gross_sales, ROUND(SUM(final_price), 2) as total_sales, ROUND(SUM(price_before_discount - price_after_discount), 2) as total_discount, ROUND(SUM(final_price - vat), 2) as net_sales, ROUND(SUM(vat), 2) as total_vat FROM `orders` inner join `branches` on `orders`.`branch_id` = `branches`.`id` WHERE (`orders`.`related_date` between '20250430' and '20250501') and (`branches`.`id` in ('2')) LIMIT 1","duration":445.06,"connection":"mysql","time":1754178078.471778,"trace":[{"call":"Illuminate\\Database\\Query\\Builder->first()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":159,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->total_values()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":40,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":null,"tags":[]},{"query":"SELECT CASE\n                    WHEN \"custom\" = \"custom\" THEN CASE\n                        WHEN DATEDIFF(STR_TO_DATE(\"20250501\", \"%Y%m%d\"),\n                             STR_TO_DATE(\"20250430\", \"%Y%m%d\")) <= 30\n                        THEN DATE_FORMAT(orders.related_date, \"%d %b\")\n                        WHEN DATEDIFF(STR_TO_DATE(\"20250501\", \"%Y%m%d\"),\n                             STR_TO_DATE(\"20250430\", \"%Y%m%d\")) <= 180\n                        THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                        ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    END\n                    WHEN \"custom\" = \"day\" THEN CASE\n                        WHEN orders.closed_at IS NULL AND orders.related_date IS NULL AND orders.day_closed = 0\n                            THEN DATE_FORMAT(orders.created_at, \"%h:%i %p\")\n                        ELSE DATE_FORMAT(orders.created_at, \"%h:%i %p\")\n                    END\n                    WHEN \"custom\" = \"week\" THEN CONCAT(DAYOFWEEK(orders.related_date), \" \", DATE_FORMAT(orders.related_date, \"%W\"))\n                    WHEN \"custom\" = \"month\" THEN CONCAT(\"Week \", WEEK(orders.related_date) - WEEK(DATE_FORMAT(orders.related_date, \"%Y-%m-01\")) + 1)\n                    WHEN \"custom\" = \"6month\" THEN CASE\n                        WHEN YEAR(DATE_SUB(NOW(), INTERVAL 6 MONTH)) < YEAR(NOW())\n                            THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                        ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    END\n                    WHEN \"custom\" = \"year\" THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                END as period, ROUND(SUM(final_price), 2) as total_sales, ROUND(SUM(final_price - vat), 2) as net_sales FROM `orders` inner join `branches` on `orders`.`branch_id` = `branches`.`id` WHERE (`orders`.`related_date` between '20250430' and '20250501') and (`branches`.`id` in ('2')) and `status` = 2 GROUP BY HOUR(orders.created_at)","duration":416.09,"connection":"mysql","time":1754178078.918147,"trace":[{"call":"Illuminate\\Database\\Query\\Builder->get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":346,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->TotalAndNetSalesLineChart()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":41,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":null,"tags":[]},{"query":"SELECT CASE\n                WHEN \"custom\" = \"custom\" THEN CASE\n                        WHEN DATEDIFF(STR_TO_DATE(\"20250501\", \"%Y%m%d\"),\n                             STR_TO_DATE(\"20250430\", \"%Y%m%d\")) <= 30\n                        THEN DATE_FORMAT(orders.related_date, \"%d %b\")\n                        WHEN DATEDIFF(STR_TO_DATE(\"20250501\", \"%Y%m%d\"),\n                             STR_TO_DATE(\"20250430\", \"%Y%m%d\")) <= 180\n                        THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                        ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    END\n                    WHEN \"custom\" = \"day\" THEN CASE\n                        WHEN orders.closed_at IS NULL AND orders.related_date IS NULL AND orders.day_closed = 0\n                            THEN DATE_FORMAT(orders.created_at, \"%h:%i %p\")\n                        ELSE DATE_FORMAT(orders.related_date, \"%h:%i %p\")\n                    END\n                    WHEN \"custom\" = \"week\" THEN CONCAT(DAYOFWEEK(orders.related_date), \" \", DATE_FORMAT(orders.related_date, \"%W\"))\n                    WHEN \"custom\" = \"month\" THEN CONCAT(\"Week \", WEEK(orders.related_date) - WEEK(DATE_FORMAT(orders.related_date, \"%Y-%m-01\")) + 1)\n                   WHEN \"custom\" = \"6month\" THEN CASE\n                        WHEN YEAR(DATE_SUB(NOW(), INTERVAL 6 MONTH)) < YEAR(NOW())\n                            THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                        ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    END\n                    WHEN \"custom\" = \"year\" THEN DATE_FORMAT(orders.related_date, \"%b %Y\")\n                    ELSE DATE_FORMAT(orders.related_date, \"%b %Y\")\n                END as period, ROUND(SUM(vat), 2) as total_tax, ROUND(SUM(price_before_discount - price_after_discount), 2) as total_discount FROM `orders` inner join `branches` on `orders`.`branch_id` = `branches`.`id` WHERE (`orders`.`related_date` between '20250430' and '20250501') and (`branches`.`id` in ('2')) and `status` = 2 GROUP BY HOUR(orders.created_at)","duration":403.43,"connection":"mysql","time":1754178079.335373,"trace":[{"call":"Illuminate\\Database\\Query\\Builder->get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":425,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->TotalDiscountAndTaxLineChart()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":42,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":null,"tags":[]},{"query":"SELECT `order_1`.`branch_id`, `branches`.`name` as `branch_name`, `order_1`.`closed_at`, `order_1`.`related_date`, CASE\n            WHEN order_1.closed_at IS NOT NULL THEN (\n                SELECT COUNT(*)\n                FROM orders as o\n                WHERE o.branch_id = order_1.branch_id\n                  AND o.related_date = order_1.related_date\n            )\n            ELSE (\n                SELECT MIN(o.created_at)\n                FROM orders as o\n                WHERE o.branch_id = order_1.branch_id\n                  AND o.closed_at IS NULL\n            )\n        END as count_or_opened_date FROM `orders` as `order_1` inner join `branches` on `branches`.`id` = `order_1`.`branch_id` inner join (SELECT branch_id, MAX(created_at) as max_created_at FROM orders GROUP BY branch_id) as order_2 on `order_1`.`branch_id` = `order_2`.`branch_id` and `order_1`.`created_at` = `order_2`.`max_created_at` WHERE `order_1`.`branch_id` in (1, 2, 3, 4, 5, 6, 7, 8, 9)","duration":942.1,"connection":"mysql","time":1754178079.73992,"trace":[{"call":"Illuminate\\Database\\Query\\Builder->get()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":278,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->closed_opened_branch()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":43,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":null,"tags":[]},{"query":"SELECT `branch_id`, SUM(final_price) as total_sales, COUNT(*) as total_orders FROM `orders` WHERE `orders`.`branch_id` != '0' and (`orders`.`related_date` between '20250430' and '20250501') and (`orders`.`status` != 3) GROUP BY `branch_id` ORDER BY `total_sales` DESC LIMIT 1","duration":458.71,"connection":"mysql","time":1754178080.682991,"trace":[{"call":"Illuminate\\Database\\Query\\Builder->first()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":490,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->topBranchSelling()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":45,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":null,"tags":[]},{"query":"SELECT * FROM `branches` WHERE `branches`.`id` = 3 LIMIT 1","duration":0.58,"connection":"mysql","time":1754178081.142572,"trace":[{"call":"Illuminate\\Database\\Eloquent\\Model::__callStatic()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Repositories\\Dashboard\\DashboardChartsRepository.php","line":496,"isVendor":false},{"call":"App\\Http\\Repositories\\Dashboard\\DashboardChartsRepository->topBranchSelling()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Controllers\\Dashboard\\DashboardChartsController.php","line":45,"isVendor":false},{"call":"App\\Http\\Controllers\\Dashboard\\DashboardChartsController->index()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Controller.php","line":54,"isVendor":true},{"call":"Illuminate\\Routing\\Controller->callAction()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\ControllerDispatcher.php","line":43,"isVendor":true},{"call":"Illuminate\\Routing\\ControllerDispatcher->dispatch()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":259,"isVendor":true},{"call":"Illuminate\\Routing\\Route->runController()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php","line":205,"isVendor":true},{"call":"Illuminate\\Routing\\Route->run()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php","line":806,"isVendor":true},{"call":"Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":144,"isVendor":true},{"call":"Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()","file":"C:\\xampp2\\htdocs\\dinex\\app\\Http\\Middleware\\CustomPermissionMiddleware.php","line":33,"isVendor":false},{"call":"App\\Http\\Middleware\\CustomPermissionMiddleware->handle()","file":"C:\\xampp2\\htdocs\\dinex\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php","line":183,"isVendor":true}],"model":"App\\Models\\Branch","tags":[]}],"databaseQueriesCount":12,"databaseSlowQueries":0,"databaseSelects":12,"databaseInserts":0,"databaseUpdates":0,"databaseDeletes":0,"databaseOthers":0,"databaseDuration":2747.07,"cacheQueries":[{"type":"miss","key":"d189a3df25facd3522214377f5876bcb","expiration":null,"time":1754178078.355804,"connection":null,"trace":[{"call":"Illuminate\\Foundation\\Http\\Kernel->handle()","file":"C:\\xampp2\\htdocs\\dinex\\public\\index.php","line":51,"isVendor":false}]},{"type":"hit","key":"d189a3df25facd3522214377f5876bcb","expiration":null,"time":1754178081.157863,"connection":null,"trace":[{"call":"Illuminate\\Foundation\\Http\\Kernel->handle()","file":"C:\\xampp2\\htdocs\\dinex\\public\\index.php","line":51,"isVendor":false}]}],"cacheReads":2,"cacheHits":1,"cacheWrites":0,"cacheDeletes":0,"cacheTime":0,"modelsActions":[],"modelsRetrieved":{"App\\Models\\PaymentType":13,"App\\Models\\Branch":11,"App\\Models\\User":1,"Spatie\\Permission\\Models\\Role":1,"Spatie\\Permission\\Models\\Permission":42},"modelsCreated":[],"modelsUpdated":[],"modelsDeleted":[],"redisCommands":[],"queueJobs":[],"timelineData":[{"description":"Controller","start":1754178078.238108,"end":1754178081.160366,"duration":2922.258138656616,"color":null,"data":null}],"log":[],"events":[],"routes":[],"notifications":[],"emailsData":[],"viewsData":[],"userData":[],"httpRequests":[],"subrequests":[],"xdebug":[],"commandName":null,"commandArguments":[],"commandArgumentsDefaults":[],"commandOptions":[],"commandOptionsDefaults":[],"commandExitCode":null,"commandOutput":null,"jobName":null,"jobDescription":null,"jobStatus":null,"jobPayload":[],"jobQueue":null,"jobConnection":null,"jobOptions":[],"testName":null,"testStatus":null,"testStatusMessage":null,"testAsserts":[],"clientMetrics":[],"webVitals":[],"parent":null,"updateToken":"dfa3df9b"}
