santosalan / lumen-crud
生成 Lumen API CRUD
v1.0.5
2019-03-29 20:27 UTC
Requires
- php: >=7.1.3
- illuminate/contracts: ~5.1
- illuminate/database: ~5.1
- illuminate/http: ~5.1
- illuminate/support: ~5.1
- laravel/lumen-framework: ^5.6
README
使用 Composer 安装
php composer.phar require santosalan/lumen-crud
在 bootstrap/app.php 中启用它
$app->withFacades(); $app->withEloquent();
在 bootstrap/app.php 中添加它
$app->register(SantosAlan\LumenCrud\ServiceProvider::class);
Doctrine 变位词 - 非规则复数和单数
如果不存在,创建文件 config/app.php 并注册此内容
return [ /** * Irregulares Words */ 'doctrine-inflector' => [ 'plural' => [ 'irregular' => [ 'traducao' => 'traducoes', ], ], 'singular' => [ 'irregular' => [ 'traducoes' => 'traducao', ], ], ], ];
在 bootstrap/app.php 中添加它,在 return $app; 之前
$app->boot(); Inflector::rules('plural', config('app.doctrine-inflector.plural')); Inflector::rules('singular', config('app.doctrine-inflector.singular'));
查看帮助
php artisan make:lumen-crud -h
查看表格
php artisan make:lumen-crud
生成基本的 Lumen-CRUD
php artisan make:lumen-crud --tables [ all | table_number ] --path-models 'App\Models' --routes=[ y | n ] --base-model [ y | n ]
或者
php artisan make:lumen-crud -t [ all | table_number ] -p 'App\Models' -r [ y | n ] -b [ y | n ]
注意:所有文件将被替换