@include('Partials.sidebar')
@include('Partials.header')

@php $sc = $lead->statusConfig(); @endphp {{ $sc['label'] }} {{ $lead->name }}

  1. Leads
  2. #{{ $lead->id }}
@foreach(['success','error'] as $t) @if(session($t))
{{ session($t) }}
@endif @endforeach
{{-- LEFT: Lead info + follow-up timeline --}}
{{-- Lead Info Card --}}
Lead Information
@foreach([ ['Phone', $lead->phone, 'fa-phone'], ['Email', $lead->email ?: '—', 'fa-envelope'], ['Source', $lead->sourceConfig()['icon'].' '.$lead->sourceConfig()['label'], 'fa-tag'], ['Interested In', $lead->interested_in ?: '—', 'fa-home'], ['Budget', $lead->budgetRange($currency), 'fa-coins'], ['Contact Time', $lead->preferred_contact_time ?: '—', 'fa-clock'], ['Assigned To', $lead->assignedAgent?->name ?? 'Unassigned', 'fa-user-tie'], ['Created', $lead->created_at->format('d M Y, H:i'), 'fa-calendar'], ] as [$label, $value, $icon])
{{ $label }}
{!! $value !!}
@endforeach
@if($lead->notes)
{{ $lead->notes }}
@endif @if($lead->isWon() && $lead->booking)
🎉 Converted! Booking #{{ $lead->booking->id }} — Unit {{ $lead->booking->plot_number }} View Booking →
@endif
{{-- Edit Form (collapsed) --}}
@csrf @method('PATCH')
{{-- Follow-up Timeline --}}
📋 Activity Timeline
@forelse($lead->followUps as $fu) @php $tc = $fu->typeConfig(); @endphp
{{ $tc['icon'] }}
{{ $tc['label'] }} by {{ $fu->admin?->name ?? 'Admin' }}
{{ $fu->created_at->format('d M, H:i') }}
{{ $fu->note }}
@if($fu->next_follow_up_at)
📅 Next: {{ $fu->next_follow_up_at->format('d M Y, H:i') }}
@endif
@empty

No activity yet. Log your first follow-up →

@endforelse
{{-- RIGHT: Actions panel --}}
{{-- Log Follow-up --}} @if(!$lead->isWon())
📞 Log Follow-up
@csrf
@foreach(\App\Models\LeadFollowUp::TYPES as $key => $tc) @endforeach
@endif {{-- Quick Contact --}}
⚡ Quick Contact
{{-- WhatsApp --}}

{{-- Email --}} @if($lead->email)
@csrf
@else
📧 No email address on file.
@endif
{{-- Convert to Booking --}} @if(!$lead->isWon() && !$lead->isLost())
🎉 Convert to Booking

Select a unit, enter amount paid, and this lead will be marked as Won with a confirmed booking.

@csrf
⚠️ The lead's phone/email must match a registered frontend user account.
@endif {{-- Danger zone --}}
@csrf @method('DELETE')
@include('Partials.footer')