hcomg / laravel-easy-generator
php artisan command to generate fully working crud with api resource by having database tables
v1.0.0
2017-05-20 09:31 UTC
Requires
- php: >=5.5.9
- dingo/api: 1.0.x@dev
- laravel/framework: >=5.0.0
Suggests
- dingo/api: A RESTful API package for the Laravel frameworks.
This package is not auto-updated.
Last update: 2025-02-02 05:28:33 UTC
README
php artisan command to generate fully working crud with api resource by having database tables
Features
1. Add api to routes.
2. Create resource controller with Dingo API.
3. Create model with Validator rules from Database.
4. ...
Requirements
Laravel >=5.1
PHP >= 5.5.9
dingo/api: 1.0.x@dev
Installation
Open your terminal(CLI), go to the root directory of your Laravel project, then follow the following procedure.
-
Install Through Composer
composer require hcomg/laravel-easy-generator --dev
-
Add the Service Provider
Open
/app/Providers/AppServiceProvider.php
and, to yourregister
function, add:public function register() { if ($this->app->environment() !== 'production') { $this->app->register(\EasyGenerator\EasyGeneratorServiceProvider::class); } }
-
Run
php artisan help hcomg:gen
to see all parameters
##Examples
php artisan hcomg:gen --model=User --table=users --controller=User Creating catalogue for table: users Model Name: User Created Controller: ./app/Models/User.php Created Controller: ./app/Http/Controllers/UserController.php Created Controller: ./app/Transformers/UserTransformer.php Adding Route: $api->resource('users', '\App\Http\Controllers\UserController');
Then run php artisan api:routes
to see the api list.