# paginateroute **Repository Path**: cbter/paginateroute ## Basic Information - **Project Name**: paginateroute - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-11 - **Last Updated**: 2024-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
.
## Installing ```shell $ composer require lambq/paginateroute -vvv ``` irst register the service provider and facade in your application. ```php // config/app.php 'providers' => [ ... 'Spatie\PaginateRoute\PaginateRouteServiceProvider', ]; 'aliases' => [ ... 'PaginateRoute' => 'Spatie\PaginateRoute\PaginateRouteFacade', ]; ``` Then register the macros in `App\Providers\RouteServiceProvider::boot()`. ```php // app/Providers/RouteServiceProvider.php use PaginateRoute; // ... public function boot() { PaginateRoute::registerMacros(); parent::boot(); } ``` ## Usage The `paginate` route macro will register two routes for you. ```php // app/Http/routes.php // Generates /users & /users/page/{page} Route::paginate('users', 'UsersController@index'); ``` In your route's action you can just use Laravel's regular pagination methods. ```php // app/Http/Controllers/UsersController.php public function index() { return view('users.index', ['users' => \App\User::simplePaginate(5)]); } ``` If you want to customize or add translations for the "page" url segment, you can publish the language files. ``` bash $ php artisan vendor:publish --provider="Lambq\Paginateroute\PaginateRouteServiceProvider" ``` TODO ## Contributing You can contribute in one of three ways: 1. File bug reports using the [issue tracker](https://github.com/lambq/paginateroute/issues). 2. Answer questions or fix bugs on the [issue tracker](https://github.com/lambq/paginateroute/issues). 3. Contribute new features or update the wiki. _The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable._ ## License MIT