@extends('layouts.app') @section('title', 'All Subscriptions') @section('content')
{{ number_format($orders->total()) }} Subscriptions
@if(session('done')) @endif @if(session('not')) @endif @php $totalRevenue = $orders->sum('price'); $activeSubscriptions = $orders->filter(function($order) { return $order->expired_date && \Carbon\Carbon::parse($order->expired_date)->isFuture(); })->count(); @endphp
Total Subscriptions

{{ number_format($orders->total()) }}

Active

{{ number_format($activeSubscriptions) }}

Expired

{{ number_format($orders->total() - $activeSubscriptions) }}

Total Revenue

${{ number_format($totalRevenue, 2) }}

@if(request('search')) Filtered results @endif
@forelse($orders as $order) @empty @endforelse
User Package Price Validity Duration Status Actions
{{ strtoupper(substr($order->name, 0, 1)) }}
{{ ucwords($order->name) }}
{{ $order->email }}
{{ $order->pakage_name ?? 'N/A' }} ${{ number_format($order->price, 2) }} {{ $order->validity ? $order->validity . ' days' : 'N/A' }}
Start: {{ $order->created_at->format('M d, Y') }} End: {{ $order->expired_date ? \Carbon\Carbon::parse($order->expired_date)->format('M d, Y') : 'N/A' }}
@php $daysLeft = $order->expired_date ? \Carbon\Carbon::now()->diffInDays($order->expired_date, false) : null; @endphp @if(is_null($daysLeft)) No Expiry @elseif($daysLeft > 0) {{ (int) $daysLeft }}d left @elseif($daysLeft == 0) Expires Today @else Expired {{ abs((int) $daysLeft) }}d ago @endif

No subscriptions found

Subscriptions will appear here when users make purchases
@if($orders->hasPages()) @endif
@endsection @section('modals') @endsection @push('style') @endpush @push('script') @endpush