@extends('layouts.admin') @section('title', 'CRM Inbox') @section('content') @php $statusTone = fn ($s) => match ($s) { 'open' => 'success', 'snoozed' => 'warning', 'closed' => 'muted', default => 'info' }; $pills = [ ['label' => 'All', 'url' => route('admin.crm.inbox.index'), 'active' => !request()->hasAny(['status','unread','assignee_id','channel'])], ['label' => 'Open', 'url' => route('admin.crm.inbox.index', ['status' => 'open']), 'active' => request('status')==='open', 'count' => $stats['open']], ['label' => 'Unread', 'url' => route('admin.crm.inbox.index', ['unread' => 1]), 'active' => (bool) request('unread'), 'count' => $stats['unread']], ['label' => 'Mine', 'url' => route('admin.crm.inbox.index', ['assignee_id' => auth()->id(), 'status' => 'open']), 'active' => (int) request('assignee_id') === (int) auth()->id(), 'count' => $stats['mine']], ['label' => 'Snoozed', 'url' => route('admin.crm.inbox.index', ['status' => 'snoozed']), 'active' => request('status')==='snoozed', 'count' => $stats['snoozed']], ]; @endphp
@foreach(request()->except(['q','page']) as $k => $v) @if(filled($v) && !is_array($v))@endif @endforeach
@if($active)

{{ $active->subject ?: 'Conversation' }}

{{ $active->status }} {{ $active->channel }} @if($active->assignee)· {{ $active->assignee->name }}@endif
@csrf
@csrf
@if($active->status !== 'closed')
@csrf
@else
@csrf
@endif
@foreach($active->messages as $message) @php $isNote = $message->direction === 'note'; $isOut = $message->direction === 'outbound'; @endphp
{{ $isNote ? 'Internal note' : ($isOut ? 'You' : 'Customer') }} {{ $message->created_at?->format('d M · H:i') }}
{!! nl2br(e($message->body_text)) !!}
@endforeach
@csrf
@csrf
@else
Select a conversation

Pick a thread to reply, assign, or snooze.

@endif
@endsection