@extends('layouts.portal') @section('title', 'Payment History') @section('page_title', 'Payment History') @section('page_subtitle', 'View all payment transactions and client payment status') @section('sidebar') @include('admin.partials.sidebar', ['active' => 'payments']) @endsection @section('content')

💰 Payment History

View and manage all payment transactions and invoices

Clients Paid

{{ $payments->where('payment_status', 'paid')->pluck('client_id')->unique()->count() }}

Clients Pending

{{ $payments->where('payment_status', 'processing')->pluck('client_id')->unique()->count() }}

Invoices Raised

{{ $payments->whereNotNull('invoice_number')->count() }}

Failed

{{ $payments->where('payment_status', 'failed')->count() }}

Total Revenue

RM{{ number_format($payments->where('payment_status', 'paid')->sum('package_price'), 2) }}

All Payments

@forelse($payments as $payment) @empty @endforelse
Payment ID Client Package Amount Payment Mode Invoice Status Payment Status Date Actions
#{{ $payment->id }}
{{ $payment->client->full_name ?? ($payment->client->first_name . ' ' . $payment->client->last_name) ?? 'N/A' }}
{{ $payment->client->email ?? 'N/A' }}
{{ $payment->package_name ?? 'Basic Package' }}
RM{{ number_format($payment->package_price ?? 0, 2) }}
{{ ucfirst(str_replace('_', ' ', $payment->payment_method ?? 'N/A')) }} @if($payment->invoice_number) Raised (#{{ $payment->invoice_number }}) @else Not Raised @endif @if($payment->payment_status === 'paid') Paid @elseif($payment->payment_status === 'processing') Processing @elseif($payment->payment_status === 'failed') Failed @else {{ ucfirst($payment->payment_status ?? 'Unknown') }} @endif {{ $payment->updated_at->format('d M Y H:i') }}
@if($payment->invoice_number) @endif View

No payments found

No payment transactions have been recorded yet.

@if($payments->hasPages())
{{ $payments->links('pagination::tailwind') }}
@endif
@endsection