I use Laravel Framework 8 (8.83.23). Please help me understand how to set a limit on the number of links.
I have this (custom template in views/vendor/pagination):
And want to get this:
Already tried this:
/** In controller */
public function index()
{
return view('pages.products.index')
->with(
'products',
Product::latest()
->paginate(12)
->onEachSide(2)
);
}
And this (without using onEachSide in controller):
/** In blade */
<div class="row py-5">
<div class="col-auto mx-auto">
{{ $products->onEachSide(2)->links() }}
</div>
</div>

