QrWallet::pricePerQr(), ]); } public function index(Request $request): View { $account = ladill_account(); $wallet = $this->manager->walletFor($account); $programmes = $account->qrCodes() ->whereIn('type', QrTypeCatalog::programmeTypes()) ->latest() ->get(); $totalSessions = $programmes->sum(function ($programme) { $days = (array) ($programme->content()['days'] ?? []); return collect($days)->sum(fn ($day) => count((array) ($day['items'] ?? []))); }); return view('events.programmes', [ 'programmes' => $programmes, 'wallet' => $wallet, 'totalSessions' => $totalSessions, 'pricePerQr' => QrWallet::pricePerQr(), 'topupUrl' => 'https://'.config('app.account_domain').'/wallet', ]); } }