phase 8 and 9

This commit is contained in:
Stefanescu Mihai
2026-03-19 18:42:19 +02:00
parent d75cabfeec
commit 82ebb697f3
94 changed files with 4498 additions and 749 deletions
+9 -1
View File
@@ -18,17 +18,25 @@ class DashboardController extends Controller
$this->authorize('view', $website);
[$from, $to] = $this->parseDateRange($request);
[$prevFrom, $prevTo] = $this->previousPeriod($from, $to);
$service = AnalyticsQueryService::for($website, $from, $to);
$prevService = AnalyticsQueryService::for($website, $prevFrom, $prevTo);
$metrics = $service->summary();
$prevMetrics = $prevService->summary();
$chartData = $service->visitorsOverTime();
$activeVisitors = AnalyticsQueryService::activeVisitors($website);
$goalConversions = $service->conversionsReport();
$goalChartData = $service->goalCompletionsOverTime();
$topPages = $service->topPages(5);
$topSources = $service->trafficSources(5);
return view('dashboard.show', compact(
'website', 'metrics', 'chartData', 'activeVisitors',
'website', 'metrics', 'prevMetrics', 'chartData', 'activeVisitors',
'goalConversions', 'goalChartData', 'from', 'to',
'topPages', 'topSources',
));
}