Laravel-4下的一個代碼生成工具 Generators

https://github.com/JeffreyWay/Laravel-4-Generators php

視頻地址 laravel

http://tutsplus.s3.amazonaws.com/tutspremium/courses_%24folder%24/WhatsNewInLaravel4/9-Generators.mp4 git


修改 github

composer.json 文件,在 shell

laravel/framework": "4.0.*


添加 json

"way/generators": "dev-master"


添加後內容以下 app


"laravel/framework": "4.0.*",
    "way/generators": "dev-master"
在命令行執行



composer update
執行完之後,在


app/config/app.php文件添加 composer

找到'providers' => array( ide

在'Illuminate\Workbench\WorkbenchServiceProvider',後面添加 spa


'Way\Generators\GeneratorsServiceProvider'
執行php artisan 多了下面幾行內容


php artisan
generate
  generate:controller   Generate a new controller.
  generate:form         Dump form HTML for a model
  generate:migration    Generate a new migration.
  generate:model        Generate a new model.
  generate:resource     Generate a resource.
  generate:scaffold     Generate scaffolding for a resource
  generate:seed         Generate a seed file.
  generate:view         Generate a new view.
相關文章
相關標籤/搜索