Skip to content

Latest commit

 

History

79 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Eye

Actions Status

Filter your Illuminate\DataBase\Query\Builder 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.

Requirements

PHP 8.1 or later.

Usage

use Railken\LaraEye\Filter;
use Railken\SQ\Exceptions\QuerySyntaxException;
use App\Foo;


// Instance of Illuminate\DataBase\Query\Builder
$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

Composer

You can install it via Composer by typing the following command:

composer require railken/lara-eye

Demo

demo

License

Open-source software licensed under the MIT license.

About

Filter your Query\Builder using a structured query language

Topics

Resources

Stars

39 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages