query('start_date') ? Carbon::parse($request->query('start_date'))->startOfDay() : null; $endDate = $request->query('end_date') ? Carbon::parse($request->query('end_date'))->endOfDay() : null; $user = $request->user(); return Inertia::render('admin/Analysis', [ 'filters' => [ 'start_date' => $request->query('start_date', ''), 'end_date' => $request->query('end_date', ''), ], 'attendance' => $this->analysisService->getAttendance($startDate, $endDate), 'myAttendance' => $user ? $this->analysisService->getMyAttendance($user, $startDate, $endDate) : null, 'isManager' => $this->analysisService->isManager($user), 'cashOverview' => $this->analysisService->getCashOverview($startDate, $endDate), 'rawMaterialStock' => $this->analysisService->getRawMaterialStock(), 'productStock' => $this->analysisService->getProductStock(), 'revenueSummary' => $this->analysisService->getRevenueSummary($startDate, $endDate), 'monthlyRevenue' => $this->analysisService->getMonthlyRevenue($startDate, $endDate), 'monthlyRevenueByChannel' => $this->analysisService->getMonthlyRevenueByChannel($startDate, $endDate), 'revenueByPaymentType' => $this->analysisService->getRevenueByPaymentType($startDate, $endDate), 'expenseSummary' => $this->analysisService->getExpenseSummary($startDate, $endDate), 'monthlyExpense' => $this->analysisService->getMonthlyExpense($startDate, $endDate), 'busyHours' => $this->analysisService->getBusyHours($startDate, $endDate), 'profitMetrics' => $this->analysisService->getProfitMetrics($startDate, $endDate), 'topSuppliers' => $this->analysisService->getTopSuppliers($startDate, $endDate), 'topCustomers' => $this->analysisService->getTopCustomers($startDate, $endDate), 'topProducts' => $this->analysisService->getTopProducts($startDate, $endDate), 'marketingSales' => $this->analysisService->getMarketingSales($startDate, $endDate), ]); } }