@extends('layouts.marketplace') @section('title', 'Community') @section('mobile_header')
groups

Community

@include('pharmacy.partials.notifications_icon', ['anchorClass' => 'flex h-10 w-10 items-center justify-center rounded-full hover:bg-slate-200 dark:hover:bg-slate-800 transition-colors relative'])
@endsection @section('mobile_content') @php $tab = request('tab', 'trending'); if (! in_array($tab, ['all', 'following', 'trending'], true)) { $tab = 'trending'; } $myPharmacyId = auth()->user()->pharmacy_id; @endphp
@csrf
Pharmacy logo
Trending Latest Following
@if($posts->count() === 0)
No posts yet.
@else @foreach($posts as $post)
Pharmacy logo

{{ $post->pharmacy?->name }}

{{ $post->created_at?->diffForHumans() }}

more_horiz
@if($post->pharmacy_id === $myPharmacyId) Edit
@csrf @method('DELETE')
@endif

{{ $post->title ?: 'Post' }}

{{ \Illuminate\Support\Str::limit($post->body, 220) }}

@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 }}
Read More
@endforeach
{{ $posts->links() }}
@endif
@endsection @section('desktop_content') @php $tab = request('tab', 'all'); if (! in_array($tab, ['all', 'following', 'trending'], true)) { $tab = 'all'; } $myPharmacyId = auth()->user()->pharmacy_id; @endphp
Pharmacy logo
@csrf
@if($posts->count() === 0)
No posts yet.
@else
@foreach($posts as $post)
Pharmacy logo
{{ $post->pharmacy?->name }} {{ $post->created_at?->diffForHumans() }}
more_horiz
@if($post->pharmacy_id === $myPharmacyId) Edit
@csrf @method('DELETE')
@endif

{{ $post->title ?: 'Post' }}

{{ \Illuminate\Support\Str::limit($post->body, 260) }}

@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 }}
Open
@endforeach
{{ $posts->links() }}
@endif
@endsection