lara eye
1.0.0
Filter your IlluminateDataBaseQueryBuilder using a structured query language.
This can be pretty usefull when you're building an API and you don't want to waste hours of your time creating predefined filters that may change at any time.
PHP 8.1 or later.
use RailkenLaraEyeFilter;
use RailkenSQExceptionsQuerySyntaxException;
use AppFoo;
// Instance of IlluminateDataBaseQueryBuilder
$query = (new Foo())->newQuery()->getQuery();
$str_filter = "x > 5 or y < z";
$filter = new Filter("foo", ['id', 'x', 'y', 'z', 'created_at', 'updated_at']);
try {
$filter->build($query, $str_filter);
} catch (QuerySyntaxException $e) {
// handle syntax error
}
Syntax here
You can install it via Composer by typing the following command:
composer require railken/lara-eyeOpen-source software licensed under the MIT license.