Add account-level Analytics page to QR Plus.
Deploy Ladill QR Plus / deploy (push) Successful in 39s
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:
@@ -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),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user