liqrgv/query-filter-laravel
Composer 安装命令:
composer create-project liqrgv/query-filter-laravel
包简介
Query filter shortcut for controller
README 文档
README
Change your Request into Query builder
With this package, we can prevent doing tedious work of composing query builder This package will turn URL query
book?filter[title][is]=Harry&filter[published_at][>]=2010-10-13
into
Book::query()
->where('title', '=', 'Harry')
->where('published_at', '>', '2010-10-13')
Getting Started
You can install this package via composer CLI using
composer require liqrgv/query-filter-laravel
Usage
You can add RequestParser class to your route closure
Route::get('/model', function(RequestParser $parser) {
$builder = $parser->getBuilder();
// do something with builder
.............
});
or on your controller
public function index(RequestParser $parser) {
$builder = $parser->getBuilder();
// do something with builder
.............
}
Running the tests
In order to running the test, you should have composer on your system.
Read more on https://getcomposer.org/doc/00-intro.md
You should install dependency for testing with
composer install
After that, you can run all test with
./phpunit
Deployment
(TBD)
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Septian Hari - Initial work - LIQRGV
See also the list of contributors who participated in this project.
License
This project is licensed under the Apache License
Acknowledgments
- Hat tip to anyone whose code was used
- Inspiration
- etc
统计信息
- 总下载量: 2.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2019-11-10