xidanko/query-filter
Composer 安装命令:
composer require xidanko/query-filter
包简介
Elegant full featured query filter for laravel.
README 文档
README
Installation
composer require xidanko/query-filter
Laravel will discover package service provider automatically
Basic Usage
First you have to add XiDanko\QueryFilter\HasFilter trait to the desired model.
This will register useFilter local scope to your model.
Now create new filter using this artisan command
php artisan make:filter <name>
This will create a new filter class in App\Filters directory, there you can define all your filter methods.
Example
After using the trait in your desired model and creating the filter class you can hype hint your class in any controller method:
public function index(Filter $yourFilterClass) { return User::useFilter($yourFilterClass)->get(); }
统计信息
- 总下载量: 194
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-08