Download the PHP package matteomeloni/laravel-rest-ql without Composer
On this page you can find all versions of the php package matteomeloni/laravel-rest-ql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download matteomeloni/laravel-rest-ql
More information about matteomeloni/laravel-rest-ql
Files in matteomeloni/laravel-rest-ql
Package laravel-rest-ql
Short Description A simple way, to be able to build a query into a Laravel model, through a http request
License MIT
Homepage https://github.com/matteomeloni/laravel-rest-ql
Informations about the package laravel-rest-ql
LaravelRestQl
A simple way, to be able to build a query into a Laravel model, through a http request.
-
Installation
-
Usage
-
How to build query
-
Passing an Array
-
Passing Data with HTTP Request
-
Examples
-
Choose columns
-
Search string
-
Where conditions
- Ordering
-
- Requirements
Installation
Via Composer
Usage
Extends your model with Matteomeloni\LaravelRestQl\LaravelRestQl
and into the controller you can use restQl
scope to make a new query
How to build query
There are three ways to build a query.
Passing an array
Passing data with HTTP Request.
You can pass data with http url parameters
or http request header
.
In this case the format is JSON and you can use base64 for encoding data.
Examples
Choose columns
Search string
Searches for the string in all columns of the table or fillable attribute.
Where conditions
Avaialable comparison operators: =
!=
<
<=
>
>=
like
not like
in
not in
between
not between
null
not null
It is possible to concatenate two or more conditions with or logic.
Multiple "where" clauses can be grouped in parentheses to achieve logical grouping in the query.
Ordering
Requirements
-
php 8.0 or later
Laravel 9
Testing
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Matteo Meloni
- All Contributors
License
MIT. Please see the license File for more information.