Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 72 | All time: 10,250 This week: 59![]() |
Version | License | PHP version | Categories | |||
lara_rest 1.0.0 | GNU General Publi... | 5 | HTTP, PHP 5, Libraries, Web services |
This package allows you to create a simple REST API on the basis of standard models (Eloquent) of the Larave 5.x Framework.
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', ]); });
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.