@extends('layouts.dashboard') @section('content')
{{'Total Revenue'}}

Kes. {{ number_format($totalRevenue, 0) }}

{{ 'Collected from completed payments' }}

{{ 'Subscribers' }}

{{ $subscribers }}

{{ 'Active subscriptions' }}

{{ $activeSubscriptionsCount }}

{{ 'Completed payments' }}

{{ $completedPaymentsCount }}

{{ 'Pending payments' }}

{{ $pendingPaymentsCount }}

{{'Plans & Subscriptions'}}

{{'A quick snapshot of plan performance and current signups'}}

{{'View All'}}
@if($plans->isEmpty())

{{'No plans available yet.'}}

@else
@foreach($plans as $plan)
{{ $plan->name }}

KES {{ number_format($plan->price, 0) }} • {{ $plan->active_subscriptions_count }} active subscribers

{{ $plan->active_subscriptions_count }}
@endforeach
@endif
{{'Recent Payments'}}
{{'View All'}}
@if($recentPayments->isEmpty())

{{'No recent payments found.'}}

@else
@foreach($recentPayments as $payment) @endforeach
{{'Customer'}}
{{'Plan'}}
{{'Amount'}}
{{'Date'}}
{{'Status'}}
@php $initials = strtoupper(substr(($payment->user->name ?? 'User'), 0, 1)); @endphp
{{ $initials }}
{{ $payment->user->name }}
{{ $payment->user->email }}
@if($payment->subscription) {{ $payment->subscription->plan->name }} @else {{ 'Resource Purchase' }} @endif {{ number_format($payment->amount, 2) }} {{ $payment->created_at->format('M d, Y') }} @if($payment->status == 'completed') {{'Success'}} @elseif($payment->status == 'pending') {{'Pending'}} @elseif($payment->status == 'failed') {{'Failed'}} @endif
@endif
@push('scripts') @endpush @endsection