@extends('client.layouts.dashboard') @section('title', 'Detailed Logs') @section('styles') @endsection @section('content')
Client Reports

Detailed Logs & Number History

Track every user, number, call, SMS, WhatsApp, and follow-up in one place.

Export Detailed Logs
{{ number_format($summary->total_events ?? 0) }}
Total Events
{{ number_format($summary->total_calls ?? 0) }}
Calls
{{ number_format($summary->total_sms ?? 0) }}
SMS
{{ number_format($summary->total_whatsapp ?? 0) }}
WhatsApp
{{ number_format($summary->unique_numbers ?? 0) }}
Unique Numbers
{{ number_format($summary->follow_ups ?? 0) }}
Follow-ups
@if(!empty($phoneNumber)) @php $selectedNumberStats = $phoneHistory->getCollection()->firstWhere('phone_number', $phoneNumber); @endphp
Selected Number Insights
{{ $phoneNumber }}
User
{{ $selectedNumberStats->user_name ?? 'N/A' }}
Total Events
{{ number_format($selectedNumberStats->total_events ?? 0) }}
First Seen
{{ !empty($selectedNumberStats->first_seen) ? \Carbon\Carbon::parse($selectedNumberStats->first_seen)->format('M d, Y h:i A') : 'N/A' }}
Last Seen
{{ !empty($selectedNumberStats->last_seen) ? \Carbon\Carbon::parse($selectedNumberStats->last_seen)->format('M d, Y h:i A') : 'N/A' }}
{{ number_format($selectedNumberStats->incoming_calls ?? 0) }} Incoming
{{ number_format($selectedNumberStats->outgoing_calls ?? 0) }} Outgoing
{{ number_format($selectedNumberStats->missed_calls ?? 0) }} Missed
@endif {{-- Multi-select dropdown styles --}}
{{-- Multi-select: USERS --}}
{{ is_array($userId) && count($userId) > 0 ? '' : 'All Users' }} @if(is_array($userId) && count($userId) > 0) {{ count($userId) }} selected @endif
@foreach($users as $user) @endforeach
{{ $users->count() }} users Clear
{{-- Phone Number --}}
{{-- Multi-select: STATUSES --}}
{{ is_array($statusKey) && count($statusKey) > 0 ? '' : 'All Statuses' }} @if(is_array($statusKey) && count($statusKey) > 0) {{ count($statusKey) }} selected @endif
@foreach(($statusOptions ?? []) as $key => $label) @endforeach
{{ count($statusOptions ?? []) }} statuses Clear
{{-- Status Note --}}
{{-- Date From --}}
{{-- Date To --}}
{{-- Has Note checkbox --}}
{{-- Filter + Clear buttons --}}
{{-- Status Breakdown Card --}} @if(!empty($statusStats) && count($statusStats) > 0) @php $statusColorMap = [ 'callback' => ['bg' => '#dbeafe', 'color' => '#1d4ed8', 'icon' => 'bi-telephone-forward'], 'follow_up' => ['bg' => '#fef3c7', 'color' => '#b45309', 'icon' => 'bi-arrow-repeat'], 'interested' => ['bg' => '#dcfce7', 'color' => '#15803d', 'icon' => 'bi-hand-thumbs-up'], 'not_interested' => ['bg' => '#fee2e2', 'color' => '#b91c1c', 'icon' => 'bi-hand-thumbs-down'], 'converted' => ['bg' => '#d1fae5', 'color' => '#065f46', 'icon' => 'bi-trophy'], 'closed' => ['bg' => '#e5e7eb', 'color' => '#374151', 'icon' => 'bi-check-circle'], ]; $defaultColor = ['bg' => '#f3f4f6', 'color' => '#6b7280', 'icon' => 'bi-tag']; @endphp
Call Status Breakdown
{{ array_sum($statusStats) }} tagged calls
@foreach($statusStats as $sk => $cnt) @php $c = $statusColorMap[strtolower($sk)] ?? $defaultColor; $label = ($statusOptions[$sk] ?? ucfirst(str_replace('_',' ',$sk))); @endphp
@php $currentStatusKeys = is_array($statusKey) ? $statusKey : []; $isActive = in_array($sk, $currentStatusKeys); // Toggle: if active remove it, if not active add it if ($isActive) { $newKeys = array_values(array_diff($currentStatusKeys, [$sk])); } else { $newKeys = array_merge($currentStatusKeys, [$sk]); } $linkParams = array_merge(request()->except('status_key', 'page'), ['status_key' => $newKeys]); @endphp
{{ number_format($cnt) }}
{{ $label }}
@endforeach {{-- With Notes card --}} @php $withNoteCount = \App\Models\CallLog::whereIn('user_id', \App\Models\User::where('client_id', $client->id)->pluck('id')) ->whereBetween('call_time', [$dateFrom.' 00:00:00', $dateTo.' 23:59:59']) ->whereNotNull('status_note')->where('status_note','!=','')->count(); @endphp
@endif
User-wise Statistics
{{ $userStats->count() }} users
@forelse($userStats as $u) @empty @endforelse
User Calls In Out Missed SMS WA
{{ $u->name }}
{{ $u->email }}
{{ number_format($u->calls_total_count) }} {{ number_format($u->calls_incoming_count) }} {{ number_format($u->calls_outgoing_count) }} {{ number_format($u->calls_missed_count) }} {{ number_format($u->sms_count) }}
No user statistics found
What this shows
Per-user progress
See how many calls, SMS, and WhatsApp messages each user generated.
Unique number history
Same number is grouped so repeated records appear as one history trail, not clutter.
Follow-ups
Spot callback and follow-up activity for better tracking.
Exportable
Download the same filtered data for reporting or audits.
Grouped Number History
@forelse($phoneHistory as $row) @empty @endforelse
User Number Total Last Seen
{{ $row->user_name ?? 'N/A' }}
{{ $row->phone_number }} @if(!empty($row->contact_name) && $row->contact_name !== '—')
{{ $row->contact_name }}
@endif
{{ number_format($row->total_events) }} {{ \Carbon\Carbon::parse($row->last_seen)->format('M d, Y h:i A') }} View History
No grouped history found
{{ $phoneHistory->appends(request()->query())->links() }}
Detailed Timeline
@if(!empty($phoneNumber))Filtered: {{ $phoneNumber }}@endif
@forelse($numberHistory as $row) @empty @endforelse
Time User Number Type Status Details Action
{{ \Carbon\Carbon::parse($row->event_time)->format('M d, Y h:i A') }}
{{ $row->user_name ?? 'N/A' }}
{{ $row->phone_number }} @if(!empty($row->contact_name) && $row->contact_name !== '—')
{{ $row->contact_name }}
@endif
@if($row->event_type === 'call') CALL @elseif($row->event_type === 'whatsapp') @else SMS @endif @if($row->event_type === 'call') @if($row->direction === 'incoming')Incoming @elseif($row->direction === 'outgoing')Outgoing @elseMissed@endif @else @if($row->message_status === 'sent')Sent @elseif($row->message_status === 'pending')Pending @elseFailed@endif @endif @if($row->event_type === 'call')
Call status: {{ $row->call_status ? ucfirst(str_replace('_', ' ', $row->call_status)) : '—' }}
Duration: {{ (int) ($row->call_duration ?? 0) }} sec @if(!empty($row->status_note))
Note: {{ $row->status_note }}@endif
@else
{{ $row->message ?? '—' }}
@endif
Focus
No detailed events found
{{ $numberHistory->appends(request()->query())->links() }}
@endsection @section('scripts') @endsection