Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 72 | All time: 10,240 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', ]); });
Files (26) |
File | Role | Description | ||
---|---|---|---|---|
src (3 files, 6 directories) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files (26) | / | src |
File | Role | Description | ||
---|---|---|---|---|
Commands (1 file) | ||||
Controllers (3 files) | ||||
Facades (1 file) | ||||
migrations (1 file) | ||||
Models (2 files) | ||||
Repositories (12 files) | ||||
RestServiceHelper.php | Class | Class source | ||
RestServiceProviderLaravel.php | Class | Class source | ||
RestServiceProviderLumen.php | Class | Class source |
Files (26) | / | src | / | Controllers |
File | Role | Description |
---|---|---|
CommonController.php | Class | Class source |
CommonResponse.php | Class | Class source |
CommonResponseBase.php | Class | Class source |
Files (26) | / | src | / | Facades |
File | Role | Description |
---|---|---|
CommonRepositoryAccessProvider.php | Class | Class source |
Files (26) | / | src | / | migrations |
File | Role | Description |
---|---|---|
2018_03_12_092835_perm_group.php | Class | Class source |
Files (26) | / | src | / | Models |
File | Role | Description |
---|---|---|
RestAccess.php | Class | Class source |
RestAccessUser.php | Class | Class source |
Files (26) | / | src | / | Repositories |
File | Role | Description |
---|---|---|
CommonRepository.php | Class | Class source |
CommonRepositoryAccessProvider.php | Class | Class source |
CommonRepositoryAccessProviderBase.php | Class | Class source |
CommonRepositoryAccessProviderDB.php | Class | Class source |
CommonRepositoryModel.php | Class | Class source |
CommonRepositoryModelProvider.php | Class | Class source |
CommonRepositoryModelProviderBase.php | Class | Class source |
CommonRepositoryModelTrait.php | Class | Class source |
Repository.php | Class | Class source |
RepositoryProvider.php | Class | Class source |
RepositoryProviderBase.php | Class | Class source |
TraitRepositoryFilter.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.