@extends('layouts.app') @section('title', 'Lead Detail') @section('content') @php $routePrefix = strtolower(auth()->user()->role->name); $canEditLeads = auth()->user()->hasPermissionName('leads.edit'); $canInteract = auth()->user()->hasPermissionName('leads.interact'); $statusColors = [ 'New' => 'primary', 'Contacted' => 'info', 'Qualified' => 'success', 'Proposal Sent' => 'warning', 'Negotiation' => 'secondary', 'Won' => 'success', 'Lost' => 'danger', ]; $stages = \App\Models\Lead::STATUSES; $currentStage = array_search($lead->status, $stages, true); @endphp

{{ $lead->name }}

{{ $lead->status }}
Lead detail, progress tracking, and interaction history.
Back @if($canEditLeads) Edit Lead @endif
@if(session('success'))
{{ session('success') }}
@endif
Lead Overview
Core account, source, and qualification information.
Phone {{ $lead->phone }}
Email {{ $lead->email ?: '-' }}
Company {{ $lead->company_name ?: '-' }}
State / Region {{ $lead->state ?: '-' }}
Company Size {{ $lead->company_size ?: '-' }}
Lead Source {{ $lead->source->name }}
Product Interest {{ $lead->product_interest ?: '-' }}
Assigned To {{ $lead->assignedTo->name ?? '-' }}
Created On {{ $lead->created_at?->format('d M Y, h:i A') }}
Lead Score
{{ $lead->lead_score }}/100
@if($lead->lost_reason)
Lost Reason {{ $lead->lost_reason }}
@endif @if($lead->notes)
Notes

{{ $lead->notes }}

@endif @if($lead->duplicate_of)
This lead may be a duplicate of lead #{{ $lead->duplicate_of }}.
@endif
Interaction Timeline
Complete activity log for this lead.
@forelse($lead->interactions as $interaction) @php $icons = [ 'call' => ['icon' => 'call', 'color' => 'success'], 'message' => ['icon' => 'chat', 'color' => 'primary'], 'note' => ['icon' => 'sticky_note_2', 'color' => 'secondary'], 'status_change' => ['icon' => 'change_circle', 'color' => 'warning'], 'reassignment' => ['icon' => 'swap_horiz', 'color' => 'info'], 'document' => ['icon' => 'description', 'color' => 'dark'], ]; $meta = $icons[$interaction->type] ?? ['icon' => 'info', 'color' => 'secondary']; @endphp
{{ $meta['icon'] }}
{{ $interaction->user->name ?? 'System' }} {{ $interaction->created_at->format('d M Y, h:i A') }}

{{ $interaction->note }}

@empty

No interactions logged yet.

@endforelse
@if($canInteract)
Log Interaction
Add a quick update for the lead activity trail.
@csrf
@endif
Stage Progress
Current position in the sales pipeline.
@foreach($stages as $index => $stage)
@if($index < $currentStage) check @elseif($index === $currentStage) radio_button_checked @else {{ $index + 1 }} @endif
{{ $stage }}
@endforeach
@endsection