@extends('layouts.app') @section('title') @lang('Lead List') @endsection @section('css') @endsection @section('content') @component('components.breadcrumb') @slot('li_1') Leads @endslot @slot('title') Lead Applications @endslot @endcomponent @if (session('success')) @endif @if (session('error')) @endif
Lead Applications
@php // Badge color + primary next-action per lead status. Mirrors the // status set in App\Models\Lead::currentStatus(); route names // confirmed against routes/web.php for each processing stage. $statusBadge = [ 100 => 'secondary', 1000 => 'secondary', 101 => 'info', 102 => 'info', 103 => 'info', 105 => 'info', 106 => 'warning', 107 => 'info', 108 => 'info', 109 => 'info', 110 => 'info', 201 => 'info', 210 => 'info', 211 => 'info', 202 => 'info', 203 => 'info', 204 => 'warning', 500 => 'info', 501 => 'success', ]; // 'menu' is the sys_menus id that owns each stage action, used to // gate the action via hasPermission($menu, 'can_view') below. $stageActions = [ 100 => ['route' => 'lead.application', 'label' => 'Fill Application', 'menu' => 2210], 1000 => ['route' => 'lead.application', 'label' => 'Fill Application', 'menu' => 2210], 101 => ['route' => 'verification.show', 'label' => 'Verify Application', 'menu' => 2310], 102 => ['route' => 'verification.show', 'label' => 'Verify Application', 'menu' => 2310], 103 => ['route' => 'verification.show', 'label' => 'Verify Application', 'menu' => 2310], 105 => ['route' => 'termsheet.show', 'label' => 'Prepare Term Sheet', 'menu' => 2320], 106 => ['route' => 'termsheet.show', 'label' => 'Update Term Sheet', 'menu' => 2320], 107 => ['route' => 'termsheet.verify', 'label' => 'Verify Term Sheet', 'menu' => 2320], 108 => ['route' => 'cp.edit_appraisal', 'label' => 'Prepare Credit Paper', 'menu' => 2410], 109 => ['route' => 'cp_verification.show', 'label' => 'Verify Credit Paper', 'menu' => 2415], 110 => ['route' => 'cp_verification.show', 'label' => 'Verify Credit Paper', 'menu' => 2415], 201 => ['route' => 'recommendation.edit', 'label' => 'Recommendation', 'menu' => 2420], 210 => ['route' => 'recommendation_verification.show', 'label' => 'Verify Recommendation', 'menu' => 2425], 211 => ['route' => 'recommendation_verification.show', 'label' => 'Verify Recommendation', 'menu' => 2425], 202 => ['route' => 'CCapproval.edit', 'label' => 'Credit Committee Approval', 'menu' => 2430], 203 => ['route' => 'BODapproval.edit', 'label' => 'Board Approval', 'menu' => 2440], 204 => ['route' => 'agreement.edit', 'label' => 'Agreement', 'menu' => 2510], 500 => ['route' => 'disbursement.edit', 'label' => 'Disbursement', 'menu' => 2520], ]; @endphp
@foreach($leads as $index => $lead) @php $stage = $stageActions[$lead->status] ?? null; if ($lead->status == 501 && !empty($lead->disbursement->proof)) { $stage = [ 'url' => 'https://' . \Illuminate\Support\Facades\Storage::disk('supportingdoc')->url($lead->disbursement->proof), 'label' => 'View Disbursement Document', 'menu' => 2520, ]; } $canDoStage = $stage && hasPermission($stage['menu'] ?? null, 'can_view'); @endphp @endforeach
Serial No. Applicant Name Factoring Pre Factoring Title Summary Status Last Updated At Actions
{{ $lead->serial_no }} {{ $lead->applicant->applicant_name ?? '-' }} {{ $lead->fund_amount ? 'RM ' . number_format($lead->fund_amount,2) : '0.00' }} {{ $lead->fund_amount ? 'RM ' . number_format($lead->pre_fund_amount,2) : '0.00' }} {{ \Illuminate\Support\Str::words($lead->title_summary, 10, '...') ?? '-' }} {{ $lead->currentStatus() ?? '-' }} {{ $lead->updated_at ? $lead->updated_at->format('d/m/Y H:i') : '-' }}
@endsection @section('script') @endsection