{{-- resources/views/agent/leads/index.blade.php --}} @extends('layouts.contentLayoutMaster') @section('title', 'My Leads') @section('page-style') @endsection @section('content')

My Leads

{{-- Tab Navigation --}} {{-- Tab Content --}}
@include('agent.leads.partials.assigned')
@include('agent.leads.partials.personal')
{{-- ==================== PURCHASED LEADS TAB ==================== --}}
@php // Expected from controller; fallbacks supported $pLife = $purchasedLifeLeads ?? ($lifePurchasedLeads ?? collect()); $pMortgage = $purchasedMortgageLeads ?? ($mortgagePurchasedLeads ?? collect()); $pHealth = $purchasedHealthLeads ?? ($healthPurchasedLeads ?? collect()); $currentPurchasedTab = request('ptype', 'life'); // 'life' | 'mortgage' | 'health' // Status set aligns with your example (capitalized) $statusOptions = ['New', 'Contacted', 'Qualified', 'Closed', 'Unresponsive']; $insuranceOptions = [ 'Term Life' => 'Term Life', 'Whole Life' => 'Whole Life', 'Universal Life' => 'Universal Life', 'Final Expense' => 'Final Expense', 'Mortgage Protection' => 'Mortgage Protection', 'Other' => 'Other', ]; @endphp {{-- Header actions for Purchased --}}
{{-- Search / Filter (keeps user on Purchased tab with #purchased) --}}
Reset
{{-- Sub-tabs for purchased types --}} {{-- Write changes --}}
@csrf @if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif @php $sets = [ 'life' => $pLife, 'mortgage' => $pMortgage, 'health' => $pHealth, ]; @endphp @foreach ($sets as $typeKey => $rows) @if ($currentPurchasedTab !== $typeKey) @continue @endif
@if ($typeKey === 'mortgage') @endif @forelse($rows as $lead) @if ($typeKey === 'mortgage') @endif {{-- Insurance Type (DB column: insurance_type) --}} {{-- Status (DB column: status) --}} {{-- Convert --}} @empty @endforelse
First Name Last Name Phone Email Age Date of BirthMortgage LenderStreet Address City State Zipcode County Purchase Date Insurance Type Status Created At Updated At Last Modified Convert
{{ $lead->first_name }} {{ $lead->last_name }} {{ $lead->phone_number }} {{ $lead->email }} {{ $lead->age }} {{ $lead->date_of_birth }} @php $m = $lead->mortgage; echo is_numeric($m) ? '$' . number_format((float) $m, 2) : e($m); @endphp {{ $lead->lender }}{{ $lead->street_address ?? $lead->address }} {{ $lead->city }} {{ $lead->state }} {{ $lead->zipcode }} {{ $lead->county }} {{ $lead->purchase_date ?? '' }} {{ $lead->created_at ?? '' }} {{ $lead->updated_at ?? '' }} {{ $lead->last_modified_at ?? '' }} @csrf
No purchased {{ $typeKey }} leads found.
@endforeach
{{-- ================== /PURCHASED LEADS TAB ================== --}}
@include('agent.leads.partials.social')
@endsection @section('page-script') @php $base = rtrim(request()->getBaseUrl(), '/'); @endphp @endsection