Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

spatie/freek.dev

636 stars
2 code files
View spatie/freek.dev on GitHub

app/Http/Controllers/HomeController.php

Open in GitHub
use App\Models\Post;
 
class HomeController
{
public function __invoke()
{
$posts = Post::query()
->published()
->simplePaginate(20);
 
return view('front.home.index', compact('posts'));
}
}

resources/views/front/home/index.blade.php

Open in GitHub
<x-app-layout>
<x-ad />
 
@include('front.posts.partials.list')
 
{{ $posts->links() }}
</x-app-layout>

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.