Show event-focused stats on the events list page.
Deploy Ladill Events / deploy (push) Successful in 27s

Replace QR balance, code count, and scan totals with account balance, event count, and confirmed registrations so the dashboard reflects the Events product.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 13:51:44 +00:00
co-authored by Cursor
parent a837098db3
commit 8618682413
2 changed files with 12 additions and 7 deletions
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Qr;
use App\Http\Controllers\Controller;
use App\Models\QrCode;
use App\Models\QrEventRegistration;
use App\Models\QrWallet;
use App\Services\Billing\BillingClient;
use App\Services\Qr\QrAnalyticsService;
@@ -44,9 +45,12 @@ class QrCodeController extends Controller
$wallet = $this->manager->walletFor($account);
$qrCodes = $account->qrCodes()
->whereIn('type', QrTypeCatalog::eventTypes())
->withCount(['eventRegistrations as registrations_count' => fn ($q) => $q->where('status', QrEventRegistration::STATUS_CONFIRMED)])
->latest()
->get();
$totalRegistrations = (int) $qrCodes->sum('registrations_count');
$ladillWalletBalance = 0.0;
try {
$ladillWalletBalance = $this->platformBilling->balanceMinor($account->public_id) / 100;
@@ -60,6 +64,7 @@ class QrCodeController extends Controller
return view('qr-codes.index', [
'wallet' => $wallet,
'qrCodes' => $qrCodes,
'totalRegistrations' => $totalRegistrations,
'pricePerQr' => QrWallet::pricePerQr(),
'minTopup' => QrWallet::minTopupGhs(),
'ladillWalletBalance' => $ladillWalletBalance,