New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

asmiarowski/lumen-api-generator

Artisan generator for API reasource.
81 6
Install
composer require asmiarowski/lumen-api-generator
Latest Version:v0.3.0
PHP:>=5.5.0
Older releases:5
License:MIT
Last Updated:Mar 21, 2016
Links: GitHub  ·  Packagist
Maintainer: asmiarowski

lumen-api-generator

Generates boilerplate for lumen REST API: migration, controller, model, request and route. Generator creates Eloquent Models and use them in generated controllers. If you want to use this package you are encouraged to uncomment $app->withEloquent in bootstrap/app.php.

Installation

``` composer require --dev asmiarowski/lumen-api-generator ```

Add this to app\Providers\AppServiceProvider inside register() method:

``` if ($this->app->environment() == 'local') { $this->app->register('Smiarowski\Generators\GeneratorsServiceProvider'); } ```

Uncomment in `bootstrap/app.php`

``` $app->register(App\Providers\AppServiceProvider::class); ``` For POST / PUT data to work you either have to send your request with `Accept: application/json` header or set up json responses globally in app/Http/Requests/Request.php like so: ``` /** * Overwrite Laravel Request method because API is always returning json * @return bool */ public function wantsJson() { return true; } ```

Command syntax

``` php artisan make:api-resource

Related Packages

asmiarowski/laravel5-api-generator

Artisan generator for API reasource.

1,756 4
thanatosxia/iseed

Generate a new Laravel database seed file based on data from the existing databa...

108 0
wn/lumen-generators

A collection of generators for Lumen and Laravel 5.

210,203 347
tdev/lumen-generators

A collection of generators for Lumen and Laravel 6.

63 0
zorgcc/lumen-generators

A collection of generators for Lumen and Laravel 5.

21 0

Version History

Version Released PHP Laravel License
v0.3.0 >=5.5.0 MIT
v0.2.0 >=5.5.0 ^5.2 MIT
v0.1.1 >=5.4.0 ^5.1 MIT