PHP code example of alanmjc / auto-pagination-laravel

1. Go to this page and download the library: Download alanmjc/auto-pagination-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alanmjc / auto-pagination-laravel example snippets


return [
    // ...
    AutoPaginationLaravel\Providers\PaginationProvider::class,
];

use AutoPaginationLaravel\Http\Middleware\PaginateMiddleware;

// ...

Route::middleware([PaginateMiddleware::class])->group(function () {
    Route::get('/test', [ExampleController::class, 'index']);
});

use AutoPaginationLaravel\Http\Middleware\PaginateMiddleware;

Route::group(['middleware' => ['auth:sanctum', PaginateMiddleware::class]], function () {
    Route::get('/test', [ExampleController::class, 'index']);
});