@if($platformMode ?? false) @else @endif @forelse(array_reverse($historyRows ?? $subscriptionHistory ?? []) as $row) @php $itemNames = collect($row['items'] ?? [])->pluck('name')->filter()->implode(', '); if (! $itemNames && ! empty($row['plan_key'])) { $itemNames = config('subscription-plans.' . $row['plan_key'] . '.name', $row['plan_key']); } if (! $itemNames && ! empty($row['pro_keys'])) { $itemNames = collect($row['pro_keys'])->map(fn ($k) => config('subscription-plans.' . $k . '.name', $k))->implode(', '); } $st = $row['status'] ?? 'pending'; $stClass = match($st) { 'active', 'approved' => 'success', 'pending' => 'warning', 'rejected' => 'danger', default => 'secondary', }; $type = $row['type'] ?? (($row['plan_key'] ?? null) ? 'bundle' : 'pro'); $expiresAt = $row['expires_at'] ?? null; if (! $expiresAt && in_array($st, ['active', 'approved'], true) && ! empty($row['approved_at'])) { $expiresAt = \Carbon\Carbon::parse($row['approved_at']) ->addMonths((int) ($row['duration_months'] ?? 1)) ->toDateString(); } @endphp @if($platformMode ?? false) @else @endif @empty @endforelse
Date Feature/Plan Type Duration Amount Payment Status Expires AtSlip ActionAction
{{ isset($row['submitted_at']) ? \Carbon\Carbon::parse($row['submitted_at'])->format('d M Y') : '—' }}
{{ isset($row['submitted_at']) ? \Carbon\Carbon::parse($row['submitted_at'])->format('h:i A') : '' }}
{{ $itemNames ?: '—' }} {{ ucfirst($type) }} {{ ($row['duration_months'] ?? '—') }} months {{ number_format($row['amount'] ?? 0, 2) }} ৳ {{ ucfirst(str_replace('_', ' ', $row['payment_method'] ?? 'bank_transfer')) }} @if(in_array($st, ['active', 'approved'], true)) @endif {{ ucfirst($st) }} @if($expiresAt)
{{ \Carbon\Carbon::parse($expiresAt)->format('d M Y') }}
@php $daysLeft = (int) now()->startOfDay()->diffInDays(\Carbon\Carbon::parse($expiresAt)->startOfDay(), false); @endphp @if($daysLeft >= 0 && in_array($st, ['active', 'approved'], true)) {{ $daysLeft }} days left @endif @else — @endif
@if(! empty($row['slip_path'])) View @else — @endif @if($st === 'pending')
@csrf
@csrf
@else {{ $row['admin_note'] ?? '—' }} @endif
@if($st === 'pending' && ! empty($row['slip_path'])) Slip @else @endif
No subscription payment history yet.