@extends('layouts.back-end.app') @section('title',translate('chatting_Page')) @push('css_or_js') @endpush @section('content')

{{translate('chatting_List')}}

@if(isset($allChattingUsers) && count($allChattingUsers) > 0) @foreach($allChattingUsers as $key => $chatting) @if($chatting->user_id && $chatting->customer)
{{ $chatting->customer->f_name .' '. $chatting->customer->l_name }} {{ $chatting->created_at->diffForHumans() }}
{{ $chatting->customer->phone }}

{{ $chatting?->message ?? 'Shared files' }}

@if(array_key_exists($chatting->user_id, $countUnreadMessages)) {{ $countUnreadMessages[$chatting->user_id] }} @endif
@if(!$chatting->seen_by_admin && !($key == 0))
@endif
@elseif($chatting->delivery_man_id && $chatting->deliveryMan)
{{ $chatting->deliveryMan->f_name.' '.$chatting->deliveryMan->l_name }} {{ $chatting->created_at->diffForHumans() }}
{{ $chatting->deliveryMan->country_code.$chatting->deliveryMan->phone }}

{{ $chatting?->message ?? 'Shared files' }}

@if(array_key_exists($chatting->delivery_man_id, $countUnreadMessages)) {{ $countUnreadMessages[$chatting->delivery_man_id] }} @endif
@if(!$chatting->seen_by_admin && !($key == 0))
@endif
@endif @endforeach
@if(request('type') == 'delivery-man')

{{ translate('No_Deliveryman_Found') }}

@else

{{ translate('No_Customer_Found') }}

@endif
@else
@if(request('type') == 'delivery-man')

{{ translate('No_Deliveryman_Found') }}

@else

{{ translate('No_Customer_Found') }}

@endif
@endif
@if(isset($lastChatUser))
Image Description
{{ $lastChatUser['f_name'].' '.$lastChatUser['l_name'] }}
{{ $lastChatUser['country_code'] }} {{ $lastChatUser['phone'] }}
@if(Request::is('admin/messages/index/customer') || Request::is('admin/messages/index/delivery-man')) @endif
@include('admin-views.chatting.messages', ['lastChatUser'=>$lastChatUser, 'chattingMessages'=>$chattingMessages])
@csrf
@else

{{ translate('you_have_not_any_conversation_yet') }}

@endif
@endsection @push('script') @endpush