@forelse ($chats as $chat) @if ($chat->sender_id === Auth::user()->id)
Person 1 @if(isset($onlineStatus[$chat->receiver_id]) && $onlineStatus[$chat->receiver_id]) @endif
@else
Person 1 @if(isset($onlineStatus[$chat->sender_id]) && $onlineStatus[$chat->sender_id]) @endif
@endif
@empty

@endforelse