@extends('admin.layouts.app') @section('page-title', 'Chat Support Dashboard') @section('content')

Live Chat Dashboard

Monitor customer conversations with real-time updates

💬

{{ $tickets->count() }}

Total Conversations

📈

{{ $tickets->where('status', 'open')->count() }}

Active Tickets

✅

{{ $tickets->where('status', 'closed')->count() }}

Resolved Tickets

📋 Active Conversations {{ $tickets->count() }}

@if($tickets->count() === 0)
💬

No Active Conversations

Customer conversations will appear here with real-time notifications.

Ready for support requests
@else
@foreach($tickets as $ticket)
@if($ticket->unread_count > 0)
@endif
{{ strtoupper(substr($ticket->user->customer_name ?? $ticket->user->name, 0, 1)) }}
{{ $ticket->user->customer_name ?? $ticket->user->name }} @if($ticket->unread_count > 0) {{ $ticket->unread_count }} @endif
@php $lastMsg = $ticket->messages()->latest()->first(); @endphp
@if($lastMsg) @if($lastMsg->message) {{ Str::limit($lastMsg->message, 55) }} @elseif(Str::startsWith($lastMsg->file_type, 'image')) 📷 Photo shared @else 📎 File attached @endif @else Conversation started @endif
@if($lastMsg)
{{ $lastMsg->created_at->diffForHumans() }}
@endif
#{{ $ticket->id }}
@endforeach
@endif
@endsection @section('scripts') @endsection