santosalan/lumen-crud

生成 Lumen API CRUD

v1.0.5 2019-03-29 20:27 UTC

This package is auto-updated.

Last update: 2024-09-29 05:21:17 UTC


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 ]

注意:所有文件将被替换