phase 8 and 9
This commit is contained in:
@@ -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',
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user