{{-- Who is paying for one product. Across every BCP account, because one product is sold to many of them and this is the super admin's view. Each row opens the subscription's own screen, where the ordinary lifecycle actions live. --}} @php $tones = [ 'trialing' => 'bg-sky-50 text-sky-700 border-sky-200', 'active' => 'bg-emerald-50 text-emerald-700 border-emerald-200', 'past_due' => 'bg-amber-50 text-amber-700 border-amber-200', 'grace' => 'bg-orange-50 text-orange-700 border-orange-200', 'suspended' => 'bg-rose-50 text-rose-700 border-rose-200', 'cancelled' => 'bg-slate-800 text-slate-400 border-slate-700', ]; @endphp
{{-- Status filter. Every status the product actually has, plus the way back to all of them. --}}
All {{ $summary['subscriptions'] }} @foreach ($summary['by_status'] as $value => $count) {{ str_replace('_', ' ', $value) }} {{ $count }} @endforeach
@forelse ($subscriptions as $subscription) @php $value = $subscription->status instanceof \BackedEnum ? $subscription->status->value : (string) $subscription->status; @endphp @empty @endforelse
Account Plan Status Trial ends Renews
{{ $subscription->tenant?->name ?? 'No account' }} #{{ $subscription->id }} {{ $subscription->plan?->name ?? 'Plan removed' }} @if ($subscription->plan?->trashed()) retired @endif {{ str_replace('_', ' ', $value) }} {{ $subscription->trial_ends_at?->format('M d, Y') ?? '—' }} {{ $subscription->current_period_ends_at?->format('M d, Y') ?? '—' }}

{{ $status ? 'No '.str_replace('_', ' ', $status).' subscriptions' : 'Nobody is subscribed to '.$product->name.' yet' }}

@if ($status) Show all statuses @endif
@if ($subscriptions->hasPages())
{{ $subscriptions->links() }}
@endif