Download the PHP package kalimulhaq/json-query without Composer
On this page you can find all versions of the php package kalimulhaq/json-query. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kalimulhaq/json-query
More information about kalimulhaq/json-query
Files in kalimulhaq/json-query
Package json-query
Short Description Build Laravel Query Using JSON Query String
License MIT
Homepage https://github.com/kalimulhaq/json-query
Informations about the package json-query
A JSON query language for your Laravel/Lumen API
JsonQuery is a query language for your Laravel/Lumen API, which convert JSON query to Laravel Eloquent ORM query.
Installation
You can install the package via composer:
Usage
Filter
filter
is a valid JSON string of the following form
Example
Select
select
is an array of columns to select from the base model, If removed *
will be used
Where
where
is a valid json object used to construct the WHERE
clause
and
to combine the where clause with AND
or
to combine the where clause with OR
Both and
and or
are arrays of objects, each object is representing one where
clause
If operator
removed =
will be used as a default operator
The (optional) outside field, value, operator, sub_operator
make a singal where clause which will be combined with AND
with the and
and or
groups.
field
column name or relationship name, if operator is has
, not_has
, where_has
, or where_not_has
the field will be consider is a relationship
value
any type of value to search. if operator is has
, not_has
, where_has
, or where_not_has
the value will be an object of where
type
operator
supported operators are =
, !=
, <
, >
, <=
, >=
, between
, not_between
, in
, not_in
, null
, not_null
, date
, day
, moth
, year
, time
, like
, has
, not_has
, where_has
, and where_not_has
sub_operator
sub operator is only required if operator
is has
or not_has
, and supported sub operators are =
, !=
, <
, >
, <=
, >=
Order
Order is used to order the rows. order
is An array of objects
Include
In order to includes related models. include
is an array of objects with same structure of the root filter
(see above) object with extra property relation
.
Include Count
In order to includes related models count. include_count
is an array of objects.
Changelog
Please see CHANGELOG for more information what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of json-query with dependencies
illuminate/support Version ^7.0|^8.0
netresearch/jsonmapper Version ^3.0