@section('page-title', 'Loans')

Loan Management

Manage employee loans and repayments

New Loan
@if(session('success'))

{{ session('success') }}

@endif @if(session('error'))

{{ session('error') }}

@endif
@forelse($loans as $loan) @empty @endforelse
Employee Amount Term Monthly Payment Balance Status Actions
{{ strtoupper(substr($loan->employee->first_name, 0, 1) . substr($loan->employee->last_name, 0, 1)) }}
{{ $loan->employee->first_name }} {{ $loan->employee->last_name }}
{{ $loan->employee->employee_id ?? 'N/A' }}
${{ number_format($loan->amount, 2) }}
{{ $loan->interest_rate }}% interest
{{ $loan->term_months }} months
@if($loan->start_date)
{{ $loan->start_date->format('M d, Y') }}
@endif
${{ number_format($loan->monthly_payment, 2) }}
${{ number_format($loan->balance, 2) }}
@php $percentPaid = $loan->amount > 0 ? (($loan->amount - $loan->balance) / $loan->amount) * 100 : 0; @endphp
@if($loan->status === 'pending') Pending @elseif($loan->status === 'approved') Approved @elseif($loan->status === 'active') Active @elseif($loan->status === 'completed') Completed @elseif($loan->status === 'rejected') Rejected @endif
@csrf @method('DELETE')

No loans found

Create First Loan
@if($loans->hasPages())
Showing {{ $loans->firstItem() }} to {{ $loans->lastItem() }} of {{ $loans->total() }} loans
{{ $loans->links() }}
@endif