Nabil Lemsieh
Nabil Lemsieh

Reputation: 716

Custom Laravel Pagination

I want to custom Laravel 4.2 pagination to something like this :

Old: www.domain.com/lorem-ipsum?page=2

New: www.domain.com/lorem-ipsum-page2

It is possible to do that?

Upvotes: 1

Views: 72

Answers (1)

Sergio Guillen Mantilla
Sergio Guillen Mantilla

Reputation: 1468

Yes, you have to specify it on your route definition:

Old:

Route::get('lorem-ipsum', function() {
    $page = Input::get['page'];
});

To:

Route::get('lorem-ipsum-page{page}', function($page) {
     // now page is as a parameter of this function, it is not necessary to get it from Input
});

Upvotes: 1

Related Questions