@extends('layouts.admin') @section('title','Chats') @section('page-title','Chat Management') @section('content')
@foreach(['','open','closed','resolved'] as $s) {{ $s ?: 'All' }} @endforeach
@forelse($threads as $thread) @empty @endforelse
Order User Last Message Status Actions
{{ optional($thread->order)->order_id ?? '—' }}

{{ optional($thread->user)->name }}

{{ optional($thread->user)->email }}

{{ optional($thread->lastMessage)->message ?? '—' }} @php $clr = ['open'=>'green','closed'=>'slate','resolved'=>'blue'][$thread->status] ?? 'slate'; @endphp {{ $thread->status }}
Open Chat @if($thread->status === 'open')
@csrf
@endif
No chat threads found.
{{ $threads->links() }}
@endsection