Download the PHP package venya/lp-rest without Composer
On this page you can find all versions of the php package venya/lp-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download venya/lp-rest
More information about venya/lp-rest
Files in venya/lp-rest
Download venya/lp-rest
More information about venya/lp-rest
Files in venya/lp-rest
Vendor venya
Package lp-rest
Short Description Зависимость для работы с REST АПИ для Lumen | Laravel
License Apache-2.0
Package lp-rest
Short Description Зависимость для работы с REST АПИ для Lumen | Laravel
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package lp-rest
Lp api rest
This package allows you to create a simple REST API on the basis of standard models (Eloquent) of the Larave 5.x Framework.
install
- composer require venya/lp-rest
Configure
-
Add app.php
$app->register(LpRest\RestServiceProvider::class); //$app->register(LpRest\RestServiceProviderLumen::class); //for Lumen
-
Add in AppServiceProvider::register
//Set model aliases app()->afterResolving(CommonRepositoryModelProvider::class, function(CommonRepositoryModelProvider $mp) { $mp->addModelAliases('user', \App\User::class); }); //Change access provider $this->app->bind(CommonRepositoryAccessProvider::class, ApiAccessProvider::class ); //Change response schema $this->app->bind(CommonResponse::class, ApiCustomResponse::class ); //Custom routes and etc $this->app->afterResolving(RestServiceHelper::class, function(RestServiceHelper $sp) { $sp->setRouteGroupOptions([ 'prefix' => 'api/rest', //'middleware' => 'auth', ]); });
API
- GET /api/rest/:modelName[/:relations] - get all items
- GET /api/rest/:modelName/:id[/:relations] - get one item
- POST /api/rest/:modelName {:json body} - create item
- PUT /api/rest/:modelName/:id {:json body} - update item
- DELETE /api/rest/:modelName/:id - remove item
- POST /api/rest/:modelName/:id {:json body - arguments} - Call model method
- POST /api/rest/multi {:json body - config any query} - Causes several methods at a time
TODO FILTER DESCRIPTION
- /api/rest/file?filter[]=created_at:range:2018-03-01,2018-05-20&filter[]=tags.id:1&filter[]=id:in:1,2,3,18
All versions of lp-rest with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
The package venya/lp-rest contains the following files
Loading the files please wait ....