Is there a way to get a pagination pretty URL in Laravel 4?
For example, by default:
http://example.com/something/?page=3
And what
For anyone that is using laravel version 5.6+
You can pass additional parameters to set the page number.
According to: https://laravel.com/api/5.6/Illuminate/Database/Eloquent/Builder.html#method_paginate
Example:
StoreController.php
/**
* Show sale item based on given page
*
* @param int $page
* @return \Illuminate\Http\Response
*/
public function showPage($page = 1)
{
$saleItems = SaleItem::paginate(10, array('*'), 'page', $page);
...
}
Then, in your blade template. You can just route( ... , array('page' => $page));