@extends('layouts.admin') @section('title', 'Lead Details') @section('content') @php $leadType = $lead->module_type ?? $lead->service?->type ?? ($lead->listing?->service?->type ?? null); $typeLabels = [ 'property' => ['label' => 'Property', 'icon' => 'bi-building', 'route' => 'admin.properties.show', 'param' => 'property'], 'job' => ['label' => 'Job', 'icon' => 'bi-briefcase', 'route' => 'admin.jobs.show', 'param' => 'job'], 'education' => ['label' => 'Education', 'icon' => 'bi-mortarboard', 'route' => 'admin.educations.show', 'param' => 'education'], 'service' => ['label' => 'Service', 'icon' => 'bi-wrench-adjustable-circle', 'route' => 'admin.services.show', 'param' => 'localService'], 'service_category' => ['label' => 'Service Category', 'icon' => 'bi-tags', 'route' => 'web.services.category.show', 'param' => 'serviceCategory'], 'contact' => ['label' => 'Contact', 'icon' => 'bi-envelope-open', 'route' => null, 'param' => null], ]; $typeInfo = $typeLabels[$leadType] ?? null; $canManage = auth()->user()?->hasPermission('leads', 'manage'); $linkedModule = $lead->module ?? $lead->listing; $linkedTitle = $linkedModule?->name ?? $linkedModule?->title ?? $lead->service?->title; $linkedLocation = $lead->location ?: ($linkedModule?->location ?? null); $backType = $leadType === 'service_category' ? 'service' : $leadType; @endphp
Review lead information and respond to the customer
Job Track: {{ $messageData['job_track'] ?? '—' }}
Category: {{ $messageData['category'] ?? '—' }}
Education: {{ $messageData['education'] ?? '—' }}
Work Experience: {{ $messageData['work_experience'] ?? '—' }}
Resume: @if(! empty($messageData['resume'])) View @else — @endif
@else{{ $lead->message ?: '—' }}
@endif @elseif($leadType === 'education') @php $messageData = json_decode($lead->message, true); @endphp @if(is_array($messageData))Program Context: {{ $messageData['program_context'] ?? '—' }}
Education Level: {{ $messageData['study_level'] ?? '—' }}
Field of Study: {{ $messageData['field_of_study'] ?? '—' }}
Preferred Destination: {{ $messageData['preferred_destination'] ?? '—' }}
Additional Notes: {{ $messageData['additional_notes'] ?? '—' }}
@else{{ $lead->message ?: '—' }}
@endif @else{{ $lead->message ?: '—' }}
@endif{{ $linkedTitle }}
{{ $linkedLocation ?: '-' }}
@if($leadType === 'service_category')Category: {{ $linkedTitle }}
@elseService: {{ $lead->service?->title ?? '-' }}
@endif @if($typeInfo && ! empty($typeInfo['route'])) Open {{ $typeInfo['label'] }} @endifThis lead isn't attached to any listing — it was submitted via the general {{ $lead->service?->title ?? 'enquiry' }} form.
@endif