lioneagle/lioneagle-paginator
Composer 安装命令:
composer require lioneagle/lioneagle-paginator
包简介
A simple package to allow Laravels Paginator to get the page size and page number from the URL query parameters.
README 文档
README
Installation
You can install the package via composer:
composer require lioneagle/lioneagle-paginator
You can publish and run the migrations with:
You can publish the config file with:
php artisan vendor:publish --provider="Lioneagle\LioneaglePaginator\LioneaglePaginatorServiceProvider" --tag="lioneagle-config"
Usage
class UserController extends Controller { public function index() { $users = User::paginator(); return UserResource($users); } }
Now a request formatted as below (when using the default config) will return a paginated response as expected;
/users?page[number]=5&page[size]=50
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-20