@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
@foreach ($chat->media as $index => $media)
@if(in_array($media->file_manager->extension ?? '', ['png', 'jpg', 'svg', 'jpeg', 'gif']))
-
@if($index == 2 && count($chat->media) > 3)
+{{ count($chat->media)-$index }}
@endif
@elseif (in_array($media->file_manager->extension ?? '', ['mp4', 'mov', 'avi', 'mkv', 'webm', 'flv']))
-
@if($index == 2 && count($post->media) > 3)
+{{ count($post->media)-$index }}
@endif
@endif
@endforeach
@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() }}