2017 © Pedro Peláez
 

library lumen-resource-api

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

image

iramgutierrez/lumen-resource-api

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  • Monday, November 14, 2016
  • by iramgutierrez
  • Repository
  • 1 Watchers
  • 2 Stars
  • 70 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Resource API Generator for Lumen 5.3

Software License, (*1)

Total Downloads, (*2)

Full resource generator for API RESTful,, (*3)

This package implements the layers pattern design, include:, (*4)

  • Entity
  • Controller
  • Manager
  • Validator
  • Repository
  • Migration
  • Route
  • Documentation (Require apidocjs installed)

Installation

Add the following line to your composer.json file:, (*5)

"iramgutierrez/lumen-resource-api": "1.3.*"

Run composer update to get the package., (*6)

Once composer has installed the package add this line of code in your bootstrap/app.php file:, (*7)

$app->register(\IramGutierrez\API\APIServiceProvider::class);

Migrations and Configuration Publishing

Add this line of code to the $commands protected array located in your app/Console/Kernel.php file:, (*8)

\Laravelista\LumenVendorPublish\VendorPublishCommand::class

Run php artisan vendor:publish to publish this package configuration and migrations. Afterwards you can edit the file config/resource_api.php to set the namespace for the resources generated., (*9)

Run migration to create required tables, (*10)

php artisan migrate

Usage

Now, you should have available the Artisan command: create-resource-api and can be used like this:, (*11)

php artisan create-resource-api {Entity}

Example

Run, (*12)

php artisan create-resource-api Test

And, the command ask you for the table name:, (*13)

Table name [tests]:

namespace:, (*14)

Path name [API]:

prefix route:, (*15)

Prefix route []:

if do you want generate documentation:, (*16)

Generate documentation? (Require apidocjs) (yes/no) [yes]:

if do you want generate the migration file:, (*17)

Generate migration? (yes/no) [yes]:

if do you want run migration:, (*18)

Run migration? (yes/no) [yes]:

if do you want add the route resource in routes.php file:, (*19)

Add routes resource? (yes/no) [yes]:

and if do you want add some middleware:, (*20)

Middlewares or middleware groups (comma separated) []:

When the execution is finished, you should have available the following functional routes:, (*21)

Route Method Uses Action
/tests GET API\TestController@index Request all tests
/tests POST API\TestController@store Store a test
/tests/:id GET API\TestController@show Request a specific test
/tests/:id PUT API\TestController@update Update a specific test
/tests/:id DELETE API\TestController@destroy Delete a specific test

License

The Lumen Resource API package is released under the MIT License., (*22)

The Versions

14/11 2016

dev-master

9999999-dev

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.3.4

1.3.4.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.3.3

1.3.3.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.3.2

1.3.2.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.3.1

1.3.1.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.3.0

1.3.0.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.2.0

1.2.0.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez

14/11 2016

1.1.0

1.1.0.0

Create a resource API for Lumen 5.3: entity, repository, manager, validator, controller, migration, table , route and documentation

  Sources   Download

MIT

The Requires

 

by Iram Gutiérrez