@extends('layouts.admin-new') @section('content')

Fulfilled Loans

@forelse($loans as $loan) @php $staff = $loan->collector_type == 'AppModelsUser' ? 'no staff' : $loan->collector; $indexes = \App\Helpers\Constants::generateCollectionCodeMap(); $user = $loan->user ?? null ; @endphp @empty @endforelse
Reference # Borrower Collection Method Payroll ID Staff Amount Tenure Date Created Loan Status Manage
{{$loan->reference}} {{ $user ? $user->name : 'No User' }} {{ in_array($loan->collection_plan, array_keys($indexes)) ? $indexes[$loan->collection_plan] : '' }} {{ $user ? optional($user->employments->first())->payroll_id : ' No user'}} {{$staff->name ?? 'No staff'}} ₦{{ number_format($loan->amount, 2)}} {{$loan->due_date->diffInMonths($loan->created_at)}} Months ({{$loan->due_date->diffForHumans()}}) {{$loan->created_at->format('Y-m-d')}} @component('components.admin-loan-status', ['loan' => $loan]) @endcomponent @if($loan->is_top_up) Top up @endif View
No active loans
@endsection @section('page-js') @endsection