butoibogdan / crud-generator
Laravel5 CRUD 生成器
dev-master
2015-06-26 07:44 UTC
Requires
- php: >=5.4.0
- illuminate/html: 5.0.*
- illuminate/support: ~5.0
This package is not auto-updated.
Last update: 2024-09-28 17:38:32 UTC
README
Laravel CRUD 生成器
安装
-
运行
composer require "appzcoder/crud-generator":"dev-master"
-
将服务提供者添加到 /config/app.php 文件中。
'providers' => [ ... 'Appzcoder\CrudGenerator\CrudGeneratorServiceProvider', ],
如果您还没有这样做,请为 "illuminate/html" 包添加以下行。
'providers' => [ ... 'Illuminate\Html\HtmlServiceProvider', ], 'aliases' => [ ... 'Form'=> 'Illuminate\Html\FormFacade', 'HTML'=> 'Illuminate\Html\HtmlFacade', ],
-
运行 composer update
注意:您还需要为此次操作配置数据库。
命令
CRUD 命令
php artisan crud:generate crud-name --fields="name:string, email:string, phone:integer, message:text"
其他命令(可选)
用于控制器生成器
php artisan crud:controller NameController --crud-name="Name"
用于模型生成器
php artisan crud:model Name --fillable="['name', 'email', 'message']"
用于迁移生成器
php artisan crud:migration migration-name --schema="name:string, email:string, phone:integer, message:text"
用于视图生成器
php artisan crud:view crud-name --fields="name:string, email:string, phone:integer, message:text"
##作者