@extends('member.layout') @section('title', 'My Loans') @section('content')

My Loans

Manage your loan applications and payments

@if($loans->count() > 0)
@endif

Total Loans

{{ $loans->count() }}

Active Loans

{{ $loans->whereIn('status', ['approved', 'active'])->count() }}

Pending

{{ $loans->where('status', 'pending')->count() }}

Total Amount

KSh {{ number_format($loans->sum('amount'), 0) }}

@if($loans->count() > 0)
@foreach($loans as $loan)

Loan #{{ $loan->id }}

{{ $loan->created_at->format('M d, Y') }}

{{ ucfirst($loan->status) }}

Principal

KSh {{ number_format($loan->amount, 0) }}

Interest

{{ $loan->interest_rate }}%

Monthly

KSh {{ number_format($loan->monthly_payment, 0) }}

Term

{{ $loan->term_months }}m

@if(in_array($loan->status, ['approved', 'active']))
Outstanding Balance KSh {{ number_format($loan->balance, 0) }}

Paid: KSh {{ number_format($loan->paid_amount, 0) }} of KSh {{ number_format($loan->total_amount, 0) }}

@endif
@if($loan->status === 'pending') @elseif(in_array($loan->status, ['approved', 'active'])) @else
@endif
@if($loan->status === 'pending')
@endif
@endforeach
@if($loans->hasPages())
{{ $loans->links() }}
@endif @else

No Loan Applications Yet

You haven't applied for any loans yet. Start your financial journey with us!

Apply for Your First Loan
@endif
@push('js') @endpush @endsection