@extends('layouts.app', ['title' => 'Inbox']) @section('content') @php($canReply = auth()->user()->can('conversations.manage')) @php($channels = \App\Models\Conversation::CHANNELS) @if (empty($connected))
No channel is connected yet, so replies are only logged. Connect WhatsApp, Instagram or email.
@endif
{{-- Conversation list --}}
{{-- Thread --}}
@if ($conversation)
{{ $conversation->displayName() }}
{{ $conversation->external_id }}
@if ($canReply)
@csrf @method('PUT') @if ($conversation->status === 'open') @else @endif
@endif
@foreach ($messages as $m)@include('inbox._message', ['m' => $m, 'tz' => $currentAccount->timezone])@endforeach
@if ($canReply)
@error('body')
{{ $message }}
@enderror @if ($conversation->channel === 'whatsapp' && ! $conversation->windowOpen())
The 24-hour reply window is closed. Send an approved template to restart the chat (you can still add internal notes).
@endif
@csrf
@if ($quickReplies->isNotEmpty()) @endif @if ($conversation->channel === 'whatsapp' && $templates->isNotEmpty()) @endif
@endif @else
Pick a conversation to read and reply.
@endif
{{-- Contact panel --}}
@if ($conversation && $conversation->contact) @php($ct = $conversation->contact)
{{ $ct->initials }}
{{ $ct->full_name }}
{{ ucfirst($ct->status) }}
@if ($ct->phone)
Phone
{{ $ct->phone }}
@endif @if ($ct->email)
Email
{{ $ct->email }}
@endif @if ($ct->source)
Source
{{ $ct->source }}
@endif @if ($ct->whatsapp_opted_in_at)
WhatsApp opt-in
{{ $ct->whatsapp_opted_in_at->timezone($currentAccount->timezone)->format('d M Y') }}
@endif
@if ($ct->tags->isNotEmpty())
@foreach ($ct->tags as $t){{ $t->name }}@endforeach
@endif Open contact @elseif ($conversation)

No contact linked to this conversation.

@endif
@if ($conversation && $canReply) @endif @if ($conversation && $canReply && $conversation->channel === 'whatsapp' && $templates->isNotEmpty()) @endif @endsection @push('scripts') @if ($conversation) @endif @endpush