{{-- resources/views/home.blade.php --}} @extends('layouts.app') @section('content')
{{-- Welcome Message --}}

Dashboard

{{ __('Welcome back, ') }} {{ Auth::user()->name }}!

@if (session('status')) @endif
{{-- Statistics Cards --}}

Total Subscribers

{{ number_format($totalSubscribers) }}

+{{ number_format($newSubscribersThisMonth) }} this month

Active Subscriptions

{{ number_format($activeSubscriptions) }}

{{ number_format($expiringThisMonth) }} expiring this month

Pending Invoices

৳{{ number_format($pendingInvoiceAmount, 2) }}

{{ number_format($pendingInvoiceCount) }} invoices pending

Total Wallet Balance

৳{{ number_format($totalWalletBalance, 2) }}

{{ number_format($activeWallets) }} active wallets
{{-- Additional Stats Row --}}

This Month's Revenue

+{{ number_format($revenueGrowth, 1) }}%

৳{{ number_format($monthlyRevenue, 2) }}

Package Distribution

{{ $packageCount }} packages
@foreach($topPackages as $package)
{{ $package->name }} {{ $package->subscriptions_count }} subs
@php $percentage = $package->subscriptions_count > 0 ? ($package->subscriptions_count / $activeSubscriptions) * 100 : 0; @endphp
@endforeach

Recent Activity

Last 7 days
New Subscriptions +{{ $newSubscriptionsLastWeek }}
Payments Received +{{ $paymentsLastWeek }}
Refunds Processed {{ $refundsLastWeek }}
Expired Subscriptions {{ $expiredLastWeek }}
{{-- Recent Activity --}}
{{-- Recent Subscriptions --}}

Recent Subscriptions

View all →
@forelse($recentSubscriptions as $subscription)
{{ substr($subscription->subscriber->name, 0, 1) }}

{{ $subscription->subscriber->name }}

{{ $subscription->package->name }}

Active

{{ $subscription->created_at->diffForHumans() }}

@empty

No recent subscriptions

@endforelse
{{-- Recent Payments --}}

Recent Payments

View all →
@forelse($recentPayments as $payment)

{{ $payment->invoice->subscriber->name ?? 'N/A' }}

{{ $payment->invoice->invoice_number ?? 'N/A' }}

৳{{ number_format($payment->amount, 2) }}

{{ $payment->payment_date->diffForHumans() }}

@empty

No recent payments

@endforelse
{{-- Recent Invoices --}}

Recent Invoices

View all →
@forelse($recentInvoices as $invoice) @empty @endforelse
Invoice # Subscriber Amount Status Date
{{ $invoice->invoice_number }} {{ $invoice->subscriber->name }} ৳{{ number_format($invoice->total_payable, 2) }} {{ str_replace('_', ' ', ucfirst($invoice->payment_status)) }} {{ $invoice->created_at->format('d M Y') }}
No recent invoices
@endsection