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')
You can install this package via composer CLI using
composer require liqrgv/query-filter-laravel
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
.............
}
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
(TBD)
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Septian Hari - Initial work - LIQRGV
See also the list of contributors who participated in this project.
This project is licensed under the Apache License
- Hat tip to anyone whose code was used
- Inspiration
- etc