Download the PHP package mrjmpl3/laravel-restful-helper without Composer
On this page you can find all versions of the php package mrjmpl3/laravel-restful-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-restful-helper
LARAVEL RESTFUL HELPER
Install
Via Composer
Usage
This packages make queries depends of the request, like GraphQL.
Requests
- Filter data: /product?column=value&column2=value2
- Sort data: /product?sort=-column1,column2
- With the negative prefix = desc
- Without the negative prefix = asc
- Fields o Select data: /product?fields=column1,column2,column3,column4
- Paginate and Per Page: /product?paginate=true&per_page=5
- Embed: /product?embed=relationfunction
Code
To Collection
To Model
From Builder to Collection
Relations
-
In model, add array like next example:
Where 'post' is the function name of relation
- In the API Resources, use the function embed
Transformers
- In model, add array like next example:
Where 'id' is the db column name , and 'code' is the column rename to response
-
In the API Resources, use the array $apiTransforms
- To used fields in API Resources , You can combine with transformers fields
Exclude Fields in Filter
- In model, add array like next example:
Where 'id' is the db column name to exclude
Change log
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-restful-helper with dependencies
illuminate/support Version ^5.5|^6.0|^7.0
illuminate/database Version ^5.5|^6.0|^7.0