Set up two routes, one without pagination and another with it.
Route::get( '{section}', array(
'as' => 'route.post',
'uses' => 'PostController@index',
))->where(array(
'section' => '(games|guides|cheats)'
));
Route::get( '{section}/page/{pageCount}', array(
'as' => 'route.post.paged',
'uses' => 'PostController@index',
))->where(array(
'section' => '(games|guides|cheats)'
));
then in your controller define the default pageCount
function index($section, $pageCount = 1){
// do something here
}
@spescina Toying with routes yesterday I ended up with this kind of solution, glad to know that someone else ended up with this solution. Thanks!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community