header('HX-Request')) { return response('', 200)->header('HX-Redirect', route('stats.dashboard')); } $tenantId = session('selected_tenant_id'); $summaryCards = $this->statService->getSummaryCards($tenantId); $salesTrend = $this->statService->getSalesTrend($tenantId); $financeTrend = $this->statService->getFinanceTrend($tenantId); $productionTrend = $this->statService->getProductionTrend($tenantId); $systemTrend = $this->statService->getSystemTrend($tenantId); $recentAlerts = $this->statService->getRecentAlerts($tenantId); $monthlySummary = $this->statService->getMonthlySummary($tenantId); return view('stats.dashboard.index', compact( 'summaryCards', 'salesTrend', 'financeTrend', 'productionTrend', 'systemTrend', 'recentAlerts', 'monthlySummary', )); } }