@php if($post->status == 0){ $url='assets/media/question-post-bg.png'; }elseif ($post->status == 1) { $url='assets/media/announcement-post-bg.png'; }else{ $url='assets/media/social-post-bg.png'; } @endphp
@if (auth()->user()->image) Logo @else Logo @endif
{{auth()->user()->first_name.' '.$post->last_name}} @php $role=AppHelper::instance()->getUserRole($post->user_id); @endphp @if ($role == 'teacher') {{ $role }} @elseif ($role == 'student') {{ $role }} @else {{ $role }} @endif
{{ $post->created_at->diffForHumans() }} @if ($post->status == 0) @elseif ($post->status == 1) @else @endif
{!! $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