@extends('layouts.marketplace') @section('title', $post->title ?: 'Community Post') @section('mobile_header')
arrow_back

Post

@include('pharmacy.partials.notifications_icon')
@endsection @section('mobile_content')
Pharmacy logo
{{ $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
@csrf
chat_bubble {{ $post->replies->count() }}
Reply
@csrf
Replies ({{ $post->replies->count() }})
@if($post->replies->count() === 0)
No replies yet.
@else
@foreach($post->replies as $reply)
{{ $reply->pharmacy?->name }}
{{ $reply->created_at?->diffForHumans() }}
{{ $reply->body }}
@endforeach
@endif
@endsection @section('desktop_content')
Pharmacy logo
{{ $post->pharmacy?->name }} {{ $post->created_at?->diffForHumans() }}
Back

{{ $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
@csrf
chat_bubble {{ $post->replies->count() }}
Reply
@csrf
Replies ({{ $post->replies->count() }})
@if($post->replies->count() === 0)
No replies yet.
@else
@foreach($post->replies as $reply)
{{ $reply->pharmacy?->name }}
{{ $reply->created_at?->diffForHumans() }}
{{ $reply->body }}
@endforeach
@endif
@endsection