From 4145c5f7d5c4600637c312c556f86e0bee1aafb2 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 4 Jul 2026 20:39:40 +0000 Subject: [PATCH] Add Merchant-style hero to Giving Pages index. Surface wallet balance, page count, and active stats in a gradient hero with balance-gated create CTA. Co-authored-by: Cursor --- .../Controllers/Give/GivingPageController.php | 7 ++ .../views/give/giving-pages/index.blade.php | 114 +++++++++++++----- 2 files changed, 92 insertions(+), 29 deletions(-) diff --git a/app/Http/Controllers/Give/GivingPageController.php b/app/Http/Controllers/Give/GivingPageController.php index 68fd667..75bcaf3 100644 --- a/app/Http/Controllers/Give/GivingPageController.php +++ b/app/Http/Controllers/Give/GivingPageController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers\Give; 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 GivingPageController extends Controller return [$qr->id => $this->imageGenerator->previewDataUri($qr)]; }); + $wallet = $this->manager->walletFor($account); + return view('give.giving-pages.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/give/giving-pages/index.blade.php b/resources/views/give/giving-pages/index.blade.php index 2802806..c9bf5a2 100644 --- a/resources/views/give/giving-pages/index.blade.php +++ b/resources/views/give/giving-pages/index.blade.php @@ -1,35 +1,91 @@ Giving Pages -
-
-
-

Giving pages

-

Branded pages with a printable QR for online giving.

-
- New giving page -
- @if($qrCodes->isEmpty()) -
-

No giving pages yet.

- Create your first giving page -
- @else -
- @foreach($qrCodes as $qr) - -
- @if(!empty($previewDataUris[$qr->id])) - - @endif -
-

{{ $qr->label }}

-

{{ $qr->content()['name'] ?? 'Organisation' }}

-

{{ $qr->is_active ? 'Active' : 'Inactive' }} · {{ $qr->publicUrl() }}

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

{{ session($flash) }}

+
+ @endif + @endforeach + +
+
+
+
+
+
+ Tithes · Offerings · Campaigns
-
- @endforeach +

Your giving pages

+

+ Branded donation pages with a printable QR. Share a Ladill Link so supporters can give online in seconds. +

+
+ +
+
+ +
+
+

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

+

Account balance

+
+
+

{{ $qrCodes->count() }}

+

Giving pages

+
+
+

{{ number_format($activeCount) }}

+

Active

+
+
+
- @endif +
+ +
+
+

Your giving pages

+
+ @if($qrCodes->isEmpty()) +

No giving pages yet. Create your first giving page to get started.

+ @else + + @endif +