@foreach ($chats as $chat) @if($chat->sender_id != auth()->id())
@if(count($chat->media)) @php $photoGalleryClass = ''; if(count($chat->media) == 1){ $photoGalleryClass = 'messagePhoto-one'; }elseif(count($chat->media) == 2){ $photoGalleryClass = 'messagePhoto-two'; }elseif(count($chat->media) == 3){ $photoGalleryClass = 'messagePhoto-three'; }elseif(count($chat->media) > 3){ $photoGalleryClass = 'messagePhoto-multi'; } @endphp @if($chat->message != NULL && $chat->message != '')

{!! nl2br($chat->message) !!}

@endif @elseif(0) @foreach ($chat->media as $index => $media) @if(in_array($media->file_manager->extension ?? '', ['pdf', 'zip']))

{{ $media->file_manager->original_name }}

{{ humanFileSize($media->file_manager->size, 'MB') }}
@endif @endforeach @else

{!! nl2br($chat->message) !!}

@endif
{{ $chat->created_at->diffForHumans() }}
@else
@if(count($chat->media)) @php $photoGalleryClass = ''; if(count($chat->media) == 1){ $photoGalleryClass = 'messagePhoto-one'; }elseif(count($chat->media) == 2){ $photoGalleryClass = 'messagePhoto-two'; }elseif(count($chat->media) == 3){ $photoGalleryClass = 'messagePhoto-three'; }elseif(count($chat->media) > 3){ $photoGalleryClass = 'messagePhoto-multi'; } @endphp @if($chat->message != NULL && $chat->message != '')

{!! nl2br($chat->message) !!}

@endif @elseif(0) @foreach ($chat->media as $index => $media) @if(in_array($media->file_manager->extension ?? '', ['pdf', 'zip']))

{{ $media->file_manager->original_name }}

{{ humanFileSize($media->file_manager->size, 'MB') }}
@endif @endforeach @else

{!! nl2br($chat->message) !!}

@endif
{{ $chat->created_at->diffForHumans() }}
@endif @endforeach