Support the ongoing development of Laravel.io →
Authentication Validation Architecture
Last updated 2 years ago.
0

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
}
Last updated 2 years ago.
0

@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!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.