@include('layouts.front.styles')
@include('layouts.front.header') @include('layouts.front.navigation')

{{$page->title??''}}

@php $category_id = $page->category_id??null; $posts = Post::whereHas('categories', function ($q) use ($category_id) { $q->where('categories.id',$category_id); })->orderBy('posts.display_at','DESC')->paginate(10); @endphp @foreach($posts as $post) @php $img_obj=$post->images()->first(); $img=$img_obj?asset('storage/post/images/' . $img_obj->image):asset('img/placeholder.png'); @endphp

{{$post->title}}

{!! $post->body !!}

@if (count($post->pdfs)) @foreach ($post->pdfs as $pdf) Click here for PDF @endforeach @endif
@endforeach @if ($posts->lastPage() > 1)
@for ($i = 1; $i <= $posts->lastPage(); $i++) {{ $i }} @endfor
@endif
@include('layouts.front.footer') @include('layouts.front.scripts') @stack('front.scripts')