@php $global = $this->getGlobalStats(); $campaigns = $this->getCampaignData(); $failed = $this->getFailedPayments(); $upcoming = $this->getUpcomingPayments(); @endphp {{-- ── Global Overview ──────────────────────────────────────── --}}
{{ number_format($global['active_subscribers']) }}
Active Subscribers
£{{ number_format($global['collected'], 2) }}
Total Collected
£{{ number_format($global['pending'], 2) }}
Pending Collection
{{ $global['collection_rate'] }}%
Collection Rate
{{-- ── Campaign Cards ──────────────────────────────────────── --}}
@foreach ($campaigns as $data) @php $c = $data['campaign']; $isActive = $c->active; $progressPct = $data['total_payments'] > 0 ? round($data['paid_payments'] / $data['total_payments'] * 100) : 0; @endphp
{{ $c->title }} @if ($isActive) ● Live @else ○ Ended @endif
{{-- Stats grid --}}
Subscribers
{{ number_format($data['active']) }} / {{ number_format($data['subscribers']) }}
Avg / Night
£{{ number_format($data['avg_per_night'], 2) }}
Collected
£{{ number_format($data['collected'], 2) }}
Pending
£{{ number_format($data['pending_amount'], 2) }}
{{-- Payment progress bar --}}
{{ number_format($data['paid_payments']) }} / {{ number_format($data['total_payments']) }} payments {{ $progressPct }}%
{{-- Key metrics --}}
Nights
{{ $data['total_nights'] }}
Completed
{{ $data['fully_completed'] ?? 0 }}
Failed
{{ $data['failed_payments'] }}
{{-- Quick links --}}
@endforeach
{{-- ── Upcoming Payments ───────────────────────────────────── --}} @if (count($upcoming) > 0)
Upcoming Payments (Next 48 Hours)
@foreach ($upcoming as $u)
{{ $u->campaign }}
{{ $u->payment_count }} payments
£{{ number_format($u->total_amount, 2) }}
{{ \Carbon\Carbon::parse($u->earliest)->diffForHumans() }}
@endforeach
@endif {{-- ── Failed Payments (Needs Attention) ───────────────────── --}} @if (count($failed) > 0)
Failed Payments — Needs Attention ({{ count($failed) }})
@foreach ($failed as $f) @endforeach
Donor Campaign Amount Expected Attempts
{{ $f->donor_name }}
{{ $f->donor_email }}
{{ $f->campaign }} £{{ number_format($f->amount / 100, 2) }} {{ \Carbon\Carbon::parse($f->expected_at)->format('d M Y') }} {{ $f->attempts }}x failed View →
@endif