Donation checkout via Ladill Pay (9% fee), church/giving QR pages, SSO, and platform scan forwarding. Co-authored-by: Cursor <cursoragent@cursor.com>
59 lines
3.7 KiB
PHP
59 lines
3.7 KiB
PHP
<x-user-layout>
|
|
<x-slot name="title">Donations</x-slot>
|
|
@php $fmt = fn ($m) => 'GHS '.number_format($m / 100, 2); @endphp
|
|
<div class="space-y-6">
|
|
<div>
|
|
<h1 class="text-xl font-semibold text-slate-900">Donations</h1>
|
|
<p class="mt-1 text-sm text-slate-500">Incoming donations across all your giving pages.</p>
|
|
</div>
|
|
<form method="get" class="max-w-md">
|
|
<input type="search" name="q" value="{{ $search }}" placeholder="Search donor, cause, reference…"
|
|
class="w-full rounded-xl border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500">
|
|
</form>
|
|
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
|
@if($donations->isEmpty())
|
|
<p class="px-6 py-10 text-sm text-slate-500">No donations yet.</p>
|
|
@else
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-slate-100 text-sm">
|
|
<thead class="bg-slate-50 text-left text-xs font-semibold uppercase tracking-wide text-slate-500">
|
|
<tr>
|
|
<th class="px-6 py-3">When</th>
|
|
<th class="px-6 py-3">Donor</th>
|
|
<th class="px-6 py-3">Cause</th>
|
|
<th class="px-6 py-3">Giving page</th>
|
|
<th class="px-6 py-3">Amount</th>
|
|
<th class="px-6 py-3">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-slate-100">
|
|
@foreach($donations as $donation)
|
|
<tr>
|
|
<td class="px-6 py-4 text-slate-600">{{ $donation->paid_at?->format('M j, g:i A') ?? $donation->created_at->format('M j, g:i A') }}</td>
|
|
<td class="px-6 py-4">
|
|
<p class="font-medium text-slate-900">{{ $donation->payer_name ?: 'Anonymous' }}</p>
|
|
@if($donation->payer_email)
|
|
<p class="text-xs text-slate-500">{{ $donation->payer_email }}</p>
|
|
@endif
|
|
</td>
|
|
<td class="px-6 py-4 text-slate-600">{{ $donation->collection_type ?: 'Donation' }}</td>
|
|
<td class="px-6 py-4 text-slate-600">{{ $donation->qrCode?->label }}</td>
|
|
<td class="px-6 py-4 font-semibold text-slate-900">{{ $fmt($donation->status === \App\Models\GiveDonation::STATUS_PAID ? $donation->merchant_amount_minor : $donation->amount_minor) }}</td>
|
|
<td class="px-6 py-4">
|
|
<span class="inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium {{ $donation->status === \App\Models\GiveDonation::STATUS_PAID ? 'bg-emerald-50 text-emerald-700' : ($donation->status === \App\Models\GiveDonation::STATUS_FAILED ? 'bg-red-50 text-red-700' : 'bg-amber-50 text-amber-700') }}">
|
|
{{ ucfirst($donation->status) }}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@if($donations->hasPages())
|
|
<div class="border-t border-slate-100 px-6 py-4">{{ $donations->links() }}</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</x-user-layout>
|