Skip to content

romansh/laravel-pretty-pagination

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Pretty Pagination

This package generates pretty pagination URLs:

http://localhost/users/page/2

Install

Install this package via Composer:

composer require ctsoft/laravel-pretty-pagination

Usage

To generate pretty URLs simply call the paginate() macro on your routes:

Route::get('/users', ...)->name('users')->paginate();

If you wan't to change the prefix (default is page):

Route::get('/users', ...)->name('users')->paginate('seite');

Or if you don't want to use any prefix:

Route::get('/users', ...)->name('users')->paginate(null);

#Trailing slashes

If you wan't to add the trailing slash (default is false):

Route::get('/users', ...)->name('users')->paginate('pages', true);
http://localhost/page/10/
Route::get('/users', ...)->name('users')->paginate('pages');
http://localhost/page/10

Notes

  • The route must have a name
  • The paginate() macro must be called as last

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

This package is open-sourced software licensed under the MIT license.

About

Pretty pagination URLs for Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%