@php $statusBadge = [ 'available' => 'bg-success', 'busy' => 'bg-danger', 'wrap_up' => 'bg-warning text-dark', 'do_not_disturb' => 'bg-secondary', 'offline' => 'bg-light text-muted border', ]; $statusIcon = [ 'available' => 'mdi-account-check-outline', 'busy' => 'mdi-phone-in-talk', 'wrap_up' => 'mdi-clipboard-text-outline', 'do_not_disturb' => 'mdi-minus-circle-outline', 'offline' => 'mdi-account-off-outline', ]; @endphp {{-- ── Page header ── --}}

Dialler Dashboard

Live — updates every 10 seconds

Live
{{-- ══════════════════════════════════════════════════════ --}} {{-- ROW 1 — STAT CARDS --}} {{-- ══════════════════════════════════════════════════════ --}}
{{-- Active Calls --}}

Active Calls

{{ $activeCalls->count() }}

{{-- Available Agents --}}

Available Agents

{{ $availableCount }} / {{ $agentStatuses->count() }}

{{-- Missed Today --}}

Missed Today

{{ $missedCalls->count() }}

{{-- Unlistened Voicemails --}}

Voicemails

{{ $voicemails->count() }}

{{-- ══════════════════════════════════════════════════════ --}} {{-- ROW 2 — AGENT AVAILABILITY + ACTIVE CALLS --}} {{-- ══════════════════════════════════════════════════════ --}}
{{-- Agent Availability --}}
Agent Availability
{{ $agentStatuses->count() }} agents
@if($agentStatuses->isEmpty())
No agents registered
@else
@foreach($agentStatuses as $s) @endforeach
Agent Status Since
{{ $s->agent?->name_first }} {{ $s->agent?->name_last }} {{ str_replace('_', ' ', ucwords($s->status)) }} {{ $s->status_changed_at?->diffForHumans() ?? '—' }}
@endif
{{-- Active Calls --}}
Active Calls
@if($activeCalls->isNotEmpty()) {{ $activeCalls->count() }} live @endif
@if($activeCalls->isEmpty())
No active calls
@else
@foreach($activeCalls as $comm) @php $callerLabel = method_exists($comm->communicable, 'getCallableLabel') ? $comm->communicable->getCallableLabel() : ($comm->call?->from_number ?? $comm->preview ?? '—'); @endphp @endforeach
Caller Agent Dir Started
{{ $callerLabel }} {{ $comm->agent?->name_first }} {{ $comm->agent?->name_last }} @if($comm->direction === 'inbound') In @else Out @endif {{ $comm->started_at?->diffForHumans() ?? '—' }}
@endif
{{-- ══════════════════════════════════════════════════════ --}} {{-- ROW 3 — MISSED CALLS + VOICEMAILS --}} {{-- ══════════════════════════════════════════════════════ --}}
{{-- Missed Calls --}}
Missed Calls today
@if($missedCalls->isNotEmpty()) {{ $missedCalls->count() }} @endif
@if($missedCalls->isEmpty())
No missed calls today
@else
@foreach($missedCalls as $comm) @php $callerLabel = method_exists($comm->communicable, 'getCallableLabel') ? $comm->communicable->getCallableLabel() : '—'; @endphp @endforeach
Caller Number Time
{{ $callerLabel }} {{ $comm->call?->from_number ?? '—' }} {{ $comm->started_at?->format('H:i') ?? '—' }}
@endif
{{-- Voicemails --}}
Voicemails unlistened
@if($voicemails->isNotEmpty()) {{ $voicemails->count() }} @endif
@if($voicemails->isEmpty())
No unlistened voicemails
@else
@foreach($voicemails as $vm) @php $communicable = $vm->communication?->communicable; $callerLabel = method_exists($communicable, 'getCallableLabel') ? $communicable->getCallableLabel() : ($vm->from_number ?? '—'); $clientUrl = $communicable instanceof \App\Models\Client\Client ? route('clients.show', $communicable) : null; $streamUrl = $vm->recording ? route('recordings.stream', $vm->recording) : null; $durLabel = $vm->recording?->duration_label ?? ($vm->duration ? sprintf('%02d:%02d', floor($vm->duration / 60), $vm->duration % 60) : '00:00'); @endphp @endforeach
Caller Recording
@if($clientUrl) {{ $callerLabel }} @else {{ $callerLabel }} @endif
{{ $vm->received_at?->diffForHumans() ?? '—' }}
@if($vm->recording?->hasStoredFile())
Could not load audio.
00:00 / {{ $durLabel }}
@elseif($vm->recording) Processing recording… @else No recording available @endif
@endif