@extends('dashboard.app') @section('page_title', 'Admin Subscriptions') @section('page_subtitle', 'Grant, revoke, and audit Pro access.') @section('dashboard_content') @if (session('status'))
{{ session('status') }}
@endif
@foreach ([ ['label' => 'Active', 'value' => number_format(\App\Models\Subscription::where('status', 'active')->count()), 'note' => 'Subscriptions'], ['label' => 'Revoked', 'value' => number_format(\App\Models\Subscription::where('status', 'revoked')->count()), 'note' => 'All time'], ['label' => 'Pending', 'value' => number_format(\App\Models\Subscription::where('status', 'pending')->count()), 'note' => 'Manual review'], ] as $card)
{{ $card['label'] }}
{{ $card['value'] }}
{{ $card['note'] }}
@endforeach
Filters
Refine subscriptions
Grant access
Create subscription
@csrf
Revoke access
Cancel subscription
@csrf
Subscription list
Recent subscriptions
@php $sortParam = $sort ?? 'id'; $dirParam = $dir ?? 'desc'; $toggle = fn ($field) => ($sortParam === $field && $dirParam === 'asc') ? 'desc' : 'asc'; $sortUrl = fn ($field) => request()->fullUrlWithQuery(['sort' => $field, 'dir' => $toggle($field)]); @endphp @forelse ($subscriptions ?? [] as $row) @empty @endforelse
Subscriber Plan Status Next billing Actions
{{ $row->user?->name ?? '—' }}
{{ $row->user?->email ?? '—' }}
{{ $row->plan }} @php $inactive = in_array($row->status, ['revoked', 'canceled', 'cancelled', 'suspended'], true); $pill = $inactive ? ['bg' => 'bg-rose-100 dark:bg-rose-500/20', 'text' => 'text-rose-800 dark:text-rose-200'] : ($row->status === 'pending' ? ['bg' => 'bg-amber-100 dark:bg-amber-500/20', 'text' => 'text-amber-800 dark:text-amber-200'] : ['bg' => 'bg-emerald-100 dark:bg-emerald-500/20', 'text' => 'text-emerald-800 dark:text-emerald-200']); @endphp {{ $row->status }} {{ $row->expires_at?->toDateString() ?? '—' }} View
No subscriptions found.
{{ $subscriptions->links('vendor.pagination.dashboard') }}
@endsection