JeffreyWay / Laravel-4-Generators

Rapidly speed up your Laravel workflow with generators
https://packagist.org/packages/way/generators
MIT License
27 stars 9 forks source link

Error using generate:resource #421

Open woganmay opened 9 years ago

woganmay commented 9 years ago

So I tried using generate:resource, and everything worked well up until it tried creating the Controller:

[ErrorException]
  file_put_contents(/vagrant/app/Http/Controllers/GearsController.php): failed to open stream: No such file or directory

It should be /vagrant/app/Controllers - not sure where it's getting Http/ from, especially since the rest of the command has the path just fine:

Do you want me to create a Gear model? [yes|no] y
Created: /vagrant/app/Gear.php
Do you want me to create views for this Gear resource? [yes|no] y
Created: /vagrant/resources/views/Gears/index.blade.php
Created: /vagrant/resources/views/Gears/show.blade.php
Created: /vagrant/resources/views/Gears/create.blade.php
Created: /vagrant/resources/views/Gears/edit.blade.php
Do you want me to create a GearsController controller? [yes|no] y

Any ideas why this is happening? I'm using generators version 3, with laravel v4.2.11

woganmay commented 9 years ago

Followup, it also breaks when trying to create the migration:

[ErrorException]
  file_put_contents(/vagrant/database/migrations/2014_11_12_143539_create_Gears_table.php): failed to open stream: No such file or directory

There it's missing the app/ folder this time.

jonsa commented 9 years ago

Generators version 3 is for the new Laravel 5 which is in development at the moment. If you want to use generators with Laravel 4 you should checkout 2.6.

If you're interested in what is changing in Laravel you can have a look at https://laracasts.com/series/whats-new-in-laravel-5