{{ $post->pharmacy?->name }}
{{ $post->created_at?->diffForHumans() }}
{{ $post->title ?: 'Post' }}
{{ $post->body }}
@php
$mediaPaths = is_array($post->media_paths) && count($post->media_paths) > 0
? $post->media_paths
: ($post->image_path ? [$post->image_path] : []);
$pdfPaths = array_values(array_filter($mediaPaths, fn ($p) => is_string($p) && \Illuminate\Support\Str::endsWith(strtolower($p), '.pdf')));
$imagePaths = array_values(array_filter($mediaPaths, fn ($p) => is_string($p) && ! \Illuminate\Support\Str::endsWith(strtolower($p), '.pdf')));
$imageUrls = array_map(fn ($p) => asset($p), $imagePaths);
@endphp
@if(count($imageUrls) > 0)
@if(count($imageUrls) === 1)
@else
@foreach($imageUrls as $i => $url)
@endforeach
@endif
@endif
@if(count($pdfPaths) > 0)
@foreach($pdfPaths as $path)
picture_as_pdf
Open PDF
@endforeach
@endif
@if($post->video_url)
play_circle
Open Video
@endif
@if($post->location_url)
location_on
Location
@endif
chat_bubble
{{ $post->replies->count() }}
Reply
Replies ({{ $post->replies->count() }})
@if($post->replies->count() === 0)
No replies yet.
@else
@foreach($post->replies as $reply)
@endforeach
@endif
{{ $reply->pharmacy?->name }}
{{ $reply->created_at?->diffForHumans() }}
{{ $reply->body }}