Laravel 項目開發(fā)規(guī)范 代碼生成器

2023-02-16 17:13 更新

遵照此規(guī)范,在實際操作中,有許多重復。接下來推薦一款專為本規(guī)范量身定做的代碼生成器 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 :



以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號