@extends('layouts.app') @section('title', 'Reports') @section('page-title', 'Reports & Analytics') @section('content') {{-- Date Filters --}}
@if($salesReps->isNotEmpty())
@endif
Reset
{{-- Summary Cards --}}
{{ number_format($totalLeads) }}
Total Leads
{{ number_format($soldLeads) }}
Deals Closed
{{ $conversionRate }}%
Conversion Rate
{{-- Daily Trend --}}
Lead Volume Trend {{ \Carbon\Carbon::parse($from)->format('M d') }} — {{ \Carbon\Carbon::parse($to)->format('M d, Y') }}
{{-- By Status Pie --}}
Status Distribution
@foreach($byStatus as $item) @php $opt = $statuses->firstWhere('value', $item->status); @endphp
{{ $opt?->label ?? $item->status }} {{ $item->total }}
@endforeach
{{-- By Source --}}
By Lead Source
{{-- By Service --}}
Top Services
@forelse($byService as $svc)
{{ $svc->service_value }}
@php $max = $byService->max('total') ?: 1; @endphp
{{ $svc->total }}
@empty

No service data.

@endforelse
{{-- Rep Performance Table --}}
Sales Representative Performance {{ $from }} → {{ $to }}
@forelse($repPerformance as $rep) @empty @endforelse @if($repPerformance->isNotEmpty()) @endif
Representative Total Leads No Answer Meeting Discussion Sold Conversion Rate
{{ $rep['name'] }}
{{ $rep['email'] }}
{{ $rep['total_leads'] }} {{ $rep['no_answer'] }} {{ $rep['meeting'] }} {{ $rep['discussion'] }} {{ $rep['sold'] }}
{{ $rep['conversion_rate'] }}%
No sales representatives found.
Total {{ $repPerformance->sum('total_leads') }} {{ $repPerformance->sum('no_answer') }} {{ $repPerformance->sum('meeting') }} {{ $repPerformance->sum('discussion') }} {{ $repPerformance->sum('sold') }} @php $total = $repPerformance->sum('total_leads'); $sold = $repPerformance->sum('sold'); @endphp {{ $total > 0 ? round(($sold/$total)*100,1) : 0 }}%
@endsection @push('scripts') @endpush