{!! $post->body !!}
@if ($post_attachments->count() > 0)
@php
$image_attachments= $post_attachments->whereIn('type',['png','jpg','gif','jpeg','svg','jfif']);
$image_count= $image_attachments->count();
$file_attachments= $post_attachments->where('post_id',$post->id)->whereNotIn('type',['png','jpg','gif','jpeg','svg','jfif','wav','mp3','mp4','mkv','webm','flv','gif']);
$audio_attachments= $post_attachments->whereIn('type',['wav','mp3']);
$video_attachments= $post_attachments->where('post_id',$post->id)->whereIn('type',['mp4','mkv','webm','flv','gif']);
@endphp
{{-- images --}}
@if ($image_count > 0)
@foreach ($image_attachments as $attachment)
@php
$random_color= Arr::random(['danger','info','secondary','primary','success']);
@endphp
@endforeach
@endif
{{-- files --}}
@if ($file_attachments->count() > 0)
@foreach ($file_attachments as $attachment)
@php
$random_color= Arr::random(['danger','info','secondary','primary','success']);
@endphp
{{ $attachment->file_name }}
{{ $attachment->formatBytes($attachment->size) }}
Download
@endforeach
@endif
@if ($audio_attachments->count() > 0)
@foreach ($audio_attachments as $attachment)
@endforeach
@endif
@if ($video_attachments->count() > 0)
@foreach ($video_attachments as $key=>$attachment)
@endforeach
@endif
@endif
-
Comments
-