@php $fmt = fn ($v) => '$'.number_format((float) $v, 2); $rev = $m['revenue']; $subs = $m['subscriptions']; $growth = $m['revenue_growth']; @endphp
Invoices Payments {{-- KPI cards --}}
{{-- Revenue chart --}}
{{-- Subscription funnel --}}
@php $funnel = [ ['Active', $subs['active'], '#22c55e'], ['Trials', $subs['trials'], '#3b82f6'], ['Renewing', $subs['renewing'], '#7c3aed'], ['Grace', $subs['grace'], '#f59e0b'], ['Suspended', $subs['suspended'], '#eab308'], ['Expired', $subs['expired'], '#94a3b8'], ['Cancelled', $subs['cancelled'], '#ef4444'], ]; $maxF = max(1, collect($funnel)->max(fn ($f) => $f[1])); @endphp @foreach ($funnel as [$label, $count, $color])
{{ $label }} {{ number_format($count) }}
@endforeach
Renewals due (15 days) {{ $subs['renewals_due'] }}
{{-- Recent invoices --}} View all
@forelse ($recentInvoices as $inv)
{{ $inv->invoice_number }}
{{ $inv->user?->name ?? '—' }}
{{ $fmt($inv->total) }}
{{ $inv->status }}
@empty

No invoices yet.

@endforelse
{{-- Recent payments --}} View all
@forelse ($recentPayments as $pay)
{{ $pay->user?->name ?? '—' }}
{{ ucfirst($pay->gateway) }} · {{ $pay->created_at->diffForHumans() }}
{{ $fmt($pay->amount) }}
{{ $pay->status }}
@empty

No payments yet.

@endforelse
@script @endscript