@extends('Admin.layout.app') @section('title', 'WhatsApp Chat') @section('content')
WhatsApp Chats
@foreach($customers as $customer)
{{ strtoupper(mb_substr($customer->name,0,1)) }}
{{ $customer->name }} {{ $customer->last_time }}
{{ $customer->last_message }} @if($customer->unread) {{ $customer->unread }} @endif
@if($customer->pending_transfer) @endif
@if(!$customer->assigned_to) Unassigned @elseif($customer->assigned_to == auth()->guard('admin')->id()) Mine @else {{ optional($customer->assignedAdmin)->name }} @endif
@endforeach
@if(isset($selected))
{{ strtoupper(substr($selected->name,0,1)) }}
{{ $selected->name }}
{{ $selected->phone }}
{{-- Ownership --}} {{-- Chat Menu --}}
@foreach($messages as $msg) @if($msg->direction=='incoming')
@if(in_array($msg->type, ['image', 'sticker'])) @elseif($msg->type == 'audio') @elseif($msg->type == 'video') @elseif($msg->type == 'document') 📄 {{ $msg->message }} @else {{ $msg->message }} @endif
{{ $msg->created_at->format('h:i A') }}
@else
@if($msg->type == 'image') @elseif($msg->type == 'audio') @elseif($msg->type == 'video') @elseif($msg->type == 'document') 📄 {{ $msg->message }} @else {{ $msg->message }} @endif
{{ $msg->created_at->format('h:i A') }}
@endif @endforeach
@csrf
🎤 Recording... 00:00
@else

WhatsApp Business

Select a customer to start chatting.

@endif
@if(isset($selected)) @endif @endsection @push('script') @if(isset($selected)) @endif @endpush