From ff6e5aee513f6bdf96e5d03a4f9c98811ccccd42 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 4 Jul 2026 20:34:29 +0000 Subject: [PATCH] Add Merchant-style hero to My Payment QR index page. Surface wallet balance, QR count, and active stats in a gradient hero with balance-gated create CTA. Co-authored-by: Cursor --- .../Controllers/Mini/PaymentQrController.php | 7 ++ .../views/mini/payment-qrs/index.blade.php | 117 +++++++++++++----- 2 files changed, 93 insertions(+), 31 deletions(-) diff --git a/app/Http/Controllers/Mini/PaymentQrController.php b/app/Http/Controllers/Mini/PaymentQrController.php index fab5e86..baddc66 100644 --- a/app/Http/Controllers/Mini/PaymentQrController.php +++ b/app/Http/Controllers/Mini/PaymentQrController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Mini; use App\Http\Controllers\Controller; use App\Models\QrCode; +use App\Models\QrWallet; use App\Services\Qr\QrCodeManagerService; use App\Services\Qr\QrImageGeneratorService; use App\Services\Qr\QrPdfExporter; @@ -36,9 +37,15 @@ class PaymentQrController extends Controller return [$qr->id => $this->imageGenerator->previewDataUri($qr)]; }); + $wallet = $this->manager->walletFor($account); + return view('mini.payment-qrs.index', [ 'qrCodes' => $qrCodes, 'previewDataUris' => $previewDataUris, + 'wallet' => $wallet, + 'activeCount' => $qrCodes->where('is_active', true)->count(), + 'pricePerQr' => QrWallet::pricePerQr(), + 'topupUrl' => 'https://'.config('app.account_domain').'/wallet', ]); } diff --git a/resources/views/mini/payment-qrs/index.blade.php b/resources/views/mini/payment-qrs/index.blade.php index 2ff9122..f2adfc4 100644 --- a/resources/views/mini/payment-qrs/index.blade.php +++ b/resources/views/mini/payment-qrs/index.blade.php @@ -1,40 +1,95 @@ My Payment QR -
-
-
-

My Payment QR

-

Static QRs to print or display — one per till or branch.

+ +
+ @foreach(['success', 'error'] as $flash) + @if(session($flash)) +
+

{{ session($flash) }}

+
+ @endif + @endforeach + +
+
+
+
+
+
+ MoMo · Card · Ladill Pay +
+

Your payment QRs

+

+ Static QRs to print or display at your counter — one per till or branch. Customers scan and pay you instantly. +

+
+ +
+
+ +
+
+

GHS {{ number_format($wallet->spendableBalance(), 2) }}

+

Account balance

+
+
+

{{ $qrCodes->count() }}

+

Payment QRs

+
+
+

{{ number_format($activeCount) }}

+

Active

+
+
+
- New payment QR
- @if(session('success')) -
{{ session('success') }}
- @endif - @if($qrCodes->isEmpty()) -