@extends('layouts.dashboard') @section('title', 'Call Logs') @section('page-title', 'Call Logs') @section('content')
Clear
Showing {{ $callLogs->count() }} of {{ $callLogs->total() }} call logs
@forelse($callLogs as $call) @empty @endforelse
ID User Phone Number Type Status Note SMS Sent Call Time Synced At
{{ $call->id }} {{ $call->user->name ?? 'N/A' }}
{{ $call->phone_number }}
@php $channelLogs = $call->smsLogs ?? collect(); $smsChannelLog = $channelLogs->firstWhere('channel', 'sms'); $whatsAppChannelLog = $channelLogs->firstWhere('channel', 'whatsapp'); $displayContactName = $call->contact_name ?: optional($smsChannelLog)->contact_name ?: optional($whatsAppChannelLog)->contact_name; @endphp @if($displayContactName) {{ $displayContactName }} @endif
{{ ucfirst($call->call_type) }} @if($call->status_label) {{ $call->status_label }} @else @endif {{ $call->status_note ?: '—' }} @if($call->sms_sent) @if($smsChannelLog) SMS {{ strtoupper((string) $smsChannelLog->status) }} @endif @if($whatsAppChannelLog) @if($smsChannelLog)
@endif WhatsApp {{ strtoupper((string) $whatsAppChannelLog->status) }} @endif @if(!$smsChannelLog && !$whatsAppChannelLog) Yes @endif @else No @endif
{{ $call->call_time->format('M d, Y H:i:s') }} {{ $call->synced_at ? $call->synced_at->format('M d, Y H:i') : '-' }}
No call logs found
{{ $callLogs->withQueryString()->links() }}
@endsection