Laravel 4 generate not working

后端 未结 4 1047
猫巷女王i
猫巷女王i 2021-02-04 15:49

I am new to frameworks please help me out with this. I am trying to create a file in controller using generate. The following is the command

php artisan generate         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-02-04 16:49

    The generate command is from the JeffreyWay/Laravel-4-Generators package, to install it you have to execute

    composer require way/generators 2.*
    

    And then add this line to your app/config/app.php in the Service Providers array:

    'Way\Generators\GeneratorsServiceProvider'
    

    After it just execute

    php artisan
    

    And check if you have the following commands available:

    generate
      generate:controller          Generate a controller
      generate:migration           Generate a new migration
      generate:model               Generate a model
      generate:pivot               Generate a pivot table
      generate:publish-templates   Copy generator templates for user modification
      generate:resource            Generate a new resource
      generate:scaffold            Scaffold a new resource (with boilerplate)
      generate:seed                Generate a database table seeder
      generate:view                Generate a view
    

提交回复
热议问题