Add account-level Analytics page to QR Plus.
Deploy Ladill QR Plus / deploy (push) Successful in 39s

Aggregates scan metrics across all codes with charts, breakdowns, and a sidebar nav item.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-19 00:57:08 +00:00
co-authored by Cursor
parent fd4ac37f0a
commit 03fffa04be
6 changed files with 359 additions and 12 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Controllers\Qr;
use App\Http\Controllers\Controller;
use App\Services\Qr\QrAnalyticsService;
use Illuminate\Http\Request;
use Illuminate\View\View;
class AnalyticsController extends Controller
{
public function __construct(private QrAnalyticsService $analytics) {}
public function index(Request $request): View
{
$account = ladill_account();
return view('qr.analytics.index', [
'summary' => $this->analytics->summaryForAccount($account),
'dailyScans' => $this->analytics->dailyScansForAccount($account, 30),
'devices' => $this->analytics->breakdownForAccount($account, 'device_type'),
'browsers' => $this->analytics->breakdownForAccount($account, 'browser'),
'topCodes' => $this->analytics->topCodesForAccount($account),
'recentScans' => $this->analytics->recentScansForAccount($account),
]);
}
}