hcomg/laravel-easy-generator
Composer 安装命令:
composer require hcomg/laravel-easy-generator
包简介
php artisan command to generate fully working crud with api resource by having database tables
README 文档
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.phpand, to yourregisterfunction, add:public function register() { if ($this->app->environment() !== 'production') { $this->app->register(\EasyGenerator\EasyGeneratorServiceProvider::class); } }
-
Run
php artisan help hcomg:gento 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.
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-17