Support the ongoing development of Laravel.io →
Requests Views Forms
Last updated 1 year ago.
0
  • add a select to your blog.blade.php with the options you want... i.e. 5,10,20,25 or whatever you want to offer as page sizes
  • add the selected value as a parameter to the route for your BlogController@showPosts($pagesize)
  • change the paginate from the hardcoded 5 to your parameter $posts = Post::paginate($pagesize);
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

reuf reuf Joined 4 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.