laramab/crudgenerator

基本Laravel CRUD生成器。

1.0.7 2020-06-05 09:52 UTC

This package is auto-updated.

Last update: 2024-09-16 14:20:51 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Output 基本Laravel CRUD生成器。

安装

composer require laramab/crudgenerator

添加crud生成器服务提供者

Laramab\Crudgenerator\CrudGeneratorServiceProvider::class,

发布配置

php artisan vendor:publish --provider="Laramab\Crudgenerator\CrudGeneratorServiceProvider"

将生成crud-generator.php配置文件,允许您自定义自己的路由、模型、迁移和控制器目录

<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Model directory
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application. This value is used when the
    | framework needs to place the application's name in a notification or
    | any other location as required by the application or its packages.
    |
    */
    'path_model' => 'app/Models',
    /*
    |--------------------------------------------------------------------------
    | Controller directory
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application. This value is used when the
    | framework needs to place the application's name in a notification or
    | any other location as required by the application or its packages.
    |
    */
    'path_controller' => 'app/Http/Controllers/Frontend',
    /*
    |--------------------------------------------------------------------------
    | Route directory
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application. This value is used when the
    | framework needs to place the application's name in a notification or
    | any other location as required by the application or its packages.
    |
    */
    'path_route' => 'routes/Backend',
    /*
    |--------------------------------------------------------------------------
    | Request directory
    |--------------------------------------------------------------------------
    |
    | This value is the name of your application. This value is used when the
    | framework needs to place the application's name in a notification or
    | any other location as required by the application or its packages.
    |
    */
    'path_request' => 'app/Http/Requests',
];

示例命令

php artisan crud:generator Gender "ភេទ" "gender" "name_km:string, name_en:string"