@foreach ($posts as $post)
{{-- @dump($post['images']) --}} @php $imageUrl = (is_array($post['images'] ?? null) && !empty($post['images'][0]['url'])) ? $post['images'][0]['url'] : ((is_array($post['images'] ?? null) && !empty($post['images'][0]['secondary_url'])) ? $post['images'][0]['secondary_url'] : asset_with_mtime('img/default-post.png')); $secondaryImageUrl = (is_array($post['images'] ?? null) && isset($post['images'][0]['secondary_url'])) ? $post['images'][0]['secondary_url'] : ''; @endphp img @if ($post['is_certif']) Annonce recommandée @endif
@php $postId = $post['id']; $postTitle = is_array($post['title'] ?? null) ? implode(' ', $post['title']) : $post['title'] ?? 'Sans titre'; @endphp {{-- favori --}}

{{ $postTitle }} @php $desc = strip_tags($post['description'] ?? ''); @endphp

{{ substr($desc, 0, 500) }}{{ strlen($desc) > 500 ? '...' : '' }}

{{-- --}}

 {{ \Carbon\Carbon::parse($post['created_at'])->diffForHumans() }}

{{ $post['visits'] ?? 0 }} {{ $post['city']['name'] ?? '-' }} Flag

{{ number_format((float) ($post['price'] ?? 0), 0, ',', ' ') }} FCFA @endforeach @if (count($posts)) 🔍 Aucune annonce disponible pour cette recherche. @endif