+
+
+
{{ $lastMessage->sender?->name ?? __('Anonymous') }}
+
{{ $lastMessage->sender?->username }}
+
+
+
+ {{__('View profile')}}
+
+
+
+ @php
+ $chatMessages = \Modules\CircleXO\App\Models\AccountContact::query()
+ ->where('account_id', auth('accounts')->user()->id)
+ ->where('sender_id', $lastMessage->sender_id)
+ ->orWhere('account_id', $lastMessage->sender_id)
+ ->where('sender_id', auth('accounts')->user()->id)
+ ->orderBy('created_at', 'asc')
+ ->get();
+
+ @endphp
+
+
+ @if($chatMessages->count() < 1)
+
+ {{ __('No Messages Here!') }}
+
+ @endif
+
+ @foreach($chatMessages as $chatMessage)
+ @if($chatMessage->sender_id == auth('accounts')->user()->id)
+ {{-- received --}}
+
+
+
+
+
{{ $chatMessage->message }}
+
+ @else
+ {{-- sent --}}
+
+
+
+
+
+ {{ $chatMessage->message }}
+
+
+ @endif
+ @endforeach
+