1

I need to change de link to the laravel pagnination.

The pagination of laravel retreun a link like this

localhost/blog?page=2

I need it to look like this

localhost/blog/2

i looking this response Laravel pagination pretty URL

but it is for laravel 4.2 And it does not work with the 5.2

i can juste change one option in the

pafinator.php

or other file

Community
  • 1
  • 1
john
  • 468
  • 1
  • 9
  • 26

1 Answers1

0

You can customize pagination view to build links you want.

The easiest way to customize the pagination views is by exporting them to your resources/views/vendor directory using the vendor:publish command:

php artisan vendor:publish --tag=laravel-pagination

And then create a new route to handle these links:

Route::get('blog/{pageId}', 'BlogController@showPage');
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279