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

Customer Support Chat

@if($tickets->count() === 0)
No customer chats yet.
@else
    @foreach($tickets as $ticket) @php // Get last message $lastMsg = $ticket->messages()->latest()->first(); @endphp
  • {{ strtoupper(substr($ticket->user->customer_name ?? $ticket->user->name, 0, 1)) }}
    {{ $ticket->user->customer_name ?? $ticket->user->name }}
    @if($lastMsg) @if($lastMsg->message) {{ Str::limit($lastMsg->message, 35) }} @elseif($lastMsg->file_type === 'image') 📷 Image @elseif($lastMsg->file_type === 'video') 🎥 Video @else 📎 Attachment @endif @else No messages yet @endif
    {{ ucfirst($ticket->status) }} Open Chat →
  • @endforeach
@endif
@endsection @section('scripts') @endsection