@extends('admin.layouts.app') @section('title', 'EMI CREDITS | Admin Dashboard') @section('page-title', 'Admin Dashboard') @section('page-description') Welcome back, {{ Auth::user()->name }} @endsection @push('styles') @endpush @section('content')
{{-- ===================================================== WELCOME ====================================================== --}}

Dashboard Overview

Monitor clients, applications, loans, KYC verification and payments from one place.

{{-- ===================================================== 8 STAT CARDS ====================================================== --}}
{{-- CLIENTS --}}
๐Ÿ‘ฅ
Total Clients
{{ $totalClients }}
View Clients โ†’
{{-- APPLICATIONS --}}
๐Ÿ“‹
Applications
{{ $totalApplications }}
View Applications โ†’
{{-- PENDING KYC --}}
๐Ÿชช
Pending KYC
{{ $pendingKyc }}
Review KYC โ†’
{{-- PAYMENTS --}}
๐Ÿ’ณ
Total Payments
{{ $totalPayments }}
View Payments โ†’
{{-- TOTAL LOANS --}}
๐Ÿ’ฐ
Total Loans
{{ $totalLoans }}
View Loans โ†’
{{-- PENDING LOANS --}}
โณ
Pending Loans
{{ $pendingLoans }}
Review Pending โ†’
{{-- ACTIVE LOANS --}}
โœ“
Active Loans
{{ $activeLoans }}
View Active โ†’
{{-- OVERDUE LOANS --}}
โš 
Overdue Loans
{{ $overdueLoans }}
Review Overdue โ†’
{{-- ===================================================== GRAPH + LOAN STATUS ====================================================== --}} @php /* * Only existing dashboard variables are used. * No new database query / controller logic required. */ $loanGraphValues = [ (float) $pendingLoans, (float) $approvedLoans, (float) $activeLoans, (float) $overdueLoans, (float) $completedLoans, ]; $loanGraphMax = max(1, max($loanGraphValues)); $pendingPercent = $totalLoans > 0 ? min(100, ($pendingLoans / $totalLoans) * 100) : 0; $approvedPercent = $totalLoans > 0 ? min(100, ($approvedLoans / $totalLoans) * 100) : 0; $activePercent = $totalLoans > 0 ? min(100, ($activeLoans / $totalLoans) * 100) : 0; $overduePercent = $totalLoans > 0 ? min(100, ($overdueLoans / $totalLoans) * 100) : 0; $completedPercent = $totalLoans > 0 ? min(100, ($completedLoans / $totalLoans) * 100) : 0; @endphp
{{-- ================================================= LOAN GRAPH ================================================== --}}

Loan Overview

Current loan portfolio status

Manage Loans โ†’
Total Loan Value {{ money($totalLoanAmount) }}
Disbursed {{ money($totalDisbursedAmount) }}
Outstanding {{ money($totalOutstandingAmount) }}
{{-- PENDING --}}
@php $height = max( 5, ($pendingLoans / $loanGraphMax) * 100 ); @endphp {{ $pendingLoans }}
{{-- APPROVED --}}
@php $height = max( 5, ($approvedLoans / $loanGraphMax) * 100 ); @endphp {{ $approvedLoans }}
{{-- ACTIVE --}}
@php $height = max( 5, ($activeLoans / $loanGraphMax) * 100 ); @endphp {{ $activeLoans }}
{{-- OVERDUE --}}
@php $height = max( 5, ($overdueLoans / $loanGraphMax) * 100 ); @endphp {{ $overdueLoans }}
{{-- COMPLETED --}}
@php $height = max( 5, ($completedLoans / $loanGraphMax) * 100 ); @endphp {{ $completedLoans }}
Pending Approved Active Overdue Completed
{{-- ================================================= LOAN STATUS ================================================== --}}

Loan Status

Portfolio distribution

View All โ†’
{{-- PENDING --}}
Pending
{{ $pendingLoans }}
{{-- APPROVED --}}
Approved
{{ $approvedLoans }}
{{-- ACTIVE --}}
Active
{{ $activeLoans }}
{{-- OVERDUE --}}
Overdue
{{ $overdueLoans }}
{{-- COMPLETED --}}
Completed
{{ $completedLoans }}
{{-- ===================================================== FINANCIAL OVERVIEW ====================================================== --}}

Financial Overview

Loan portfolio financial summary

Manage Loans โ†’
๐Ÿ’ต
Total Loan Amount {{ money($totalLoanAmount) }}
๐Ÿ“ค
Total Disbursed {{ money($totalDisbursedAmount) }}
๐Ÿ“Š
Outstanding {{ money($totalOutstandingAmount) }}
๐Ÿงพ
Processing Fees {{ money($totalProcessingFees) }}
{{-- ===================================================== KYC + QUICK ACTIONS ====================================================== --}}
{{-- ================================================= KYC OVERVIEW ================================================== --}}

KYC Overview

Client verification status

View All โ†’
โณ
Pending Verification
{{ $pendingKyc }}
โœ“
Verified
{{ $verifiedKyc }}
โœ•
Rejected
{{ $rejectedKyc }}
{{-- ================================================= QUICK ACTIONS ================================================== --}}
{{-- ===================================================== RECENT NOTIFICATIONS ====================================================== --}} @php $dashboardNotifications = Auth::user() ->notifications() ->latest() ->take(5) ->get(); @endphp

Recent Notifications

Latest system and loan updates

View All โ†’
@forelse($dashboardNotifications as $notification) @php $notificationData = $notification->data ?? []; $notificationTitle = data_get( $notificationData, 'title', 'Notification' ); $notificationMessage = data_get( $notificationData, 'message', '' ); $notificationLevel = data_get( $notificationData, 'level', 'info' ); if ( !in_array( $notificationLevel, [ 'success', 'warning', 'error', 'info' ], true ) ) { $notificationLevel = 'info'; } $notificationLoan = data_get( $notificationData, 'loan_number' ); $notificationBg = $notificationLevel === 'success' ? '#e8f8ef' : ( $notificationLevel === 'warning' ? '#fff4df' : ( $notificationLevel === 'error' ? '#fff1f2' : '#eaf2ff' ) ); $notificationIcon = $notificationLevel === 'success' ? 'โœ“' : ( $notificationLevel === 'warning' ? 'โš ' : ( $notificationLevel === 'error' ? '!' : '๐Ÿ””' ) ); @endphp
{{ $notificationIcon }}
{{ $notificationTitle }}
{{ $notificationMessage }}
{{ $notification->created_at?->diffForHumans() ?? '' }} @if($notificationLoan) ยท {{ $notificationLoan }} @endif
@if(!$notification->read_at)
@csrf
@endif
@empty
๐Ÿ””
No notifications New loan and payment updates will appear here.
@endforelse
@endsection