@php $posts = collect($blogPosts ?? [])->map(function ($post) { return [ 'title' => $post->title, 'date' => $post->published_at ? \Carbon\Carbon::parse($post->published_at)->format('F j, Y') : null, 'comments' => 0, 'img' => $post->cover_image ? asset('storage/' . ltrim($post->cover_image, '/')) : asset('assets/img/blog/blog-1.jpg'), 'href' => route('blog.show', $post->slug), ]; })->values(); $desktopChunks = $posts->chunk(4)->values(); @endphp @if($posts->count())
{{-- Heading --}}

Blog Posts

One inspiring story is worth traveling. Discover local food, tradition and history — stories that make you want to travel.

{{-- Desktop controls --}} @if($desktopChunks->count() > 1) @endif {{-- Desktop / Tablet slider --}} {{-- Mobile horizontal swipe slider --}}
@foreach($posts as $p) @endforeach
@endif