Laravel 项目开发规范 代码生成器

2023-02-16 17:13 更新

遵照此规范,在实际操作中,有许多重复。接下来推荐一款专为本规范量身定做的代码生成器 Laravel Scaffold Generator

只需要一个命令:


即可生成:

php artisan make:scaffold Projects --schema="name:string:index,description:text:nullable,subscriber_count:integer:unsigned:default(0)"

----------- scaffolding: Project -----------

+ ./database/migrations/2017_05_23_070517_create_projects_table.php
+ ./database/factories/ModelFactory.php
+ ./database/seeds/ProjectsTableSeeder.php
+ ./database/seeds/DatabaseSeeder.php (Updated)
+ ./app/Models/Model.php (Updated)
+ ./app/Models/Project.php
+ ./app/Http/Controllers/ProjectsController.php
+ ./app/Http/Requests/Request.php
+ ./app/Http/Requests/ProjectRequest.php
+ ./app/Observers/UserObserver.php (Skipped)
+ ./app/Observers/ProjectObserver.php
+ ./app/Providers/AppServiceProvider.php (Updated)
+ ./app/Policies/Policy.php
+ ./app/Policies/ProjectPolicy.php
+ ./app/Providers/AuthServiceProvider.php (Updated)
+ ./routes/web.php (Updated)

--- Views ---
   + create_and_edit.blade.php
   + index.blade.php
   + show.blade.php
+ ./resources/views/layouts/app.blade.php
+ ./resources/views/common/error.blade.php
Migration table created successfully.
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrated: 2017_05_23_070517_create_projects_table

----------- -------------------- -----------
-----------   >DUMP AUTOLOAD<    -----------

访问 homestead.app/projects :



以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号