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

4.3/5.0 Generator #413

Closed mfutselaar closed 9 years ago

mfutselaar commented 9 years ago

I've had this issue in each Laravel 4.3/5.0 project.

When running php artisan generate:scaffold or php artisan generate:resource, I get the following error when it comes to the "Generate xxxController" part. It has been around for at least a week.

PHP Fatal error: Class 'Way\Generators\Templates\Data\Controller' not found in /home/mathijs/PhpstormProjects/xxxx/vendor/way/generators/src/Way/Generators/Commands/ControllerGeneratorCommand.php on line 40 {"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Class 'Way\Generators\Templates\Data\Controller' not found","file":"\/home\/mathijs\/PhpstormProjects\xxxx\/vendor\/way\

The controller class does exist.

mathijs@milenniumfalcon:~/PhpstormProjects/xxxx/vendor/way/generators/src/Way/Generators/templates/Data$ ls -alF |grep Controller -rw-rw-r-- 1 mathijs mathijs 1806 okt 1 06:00 Controller.php

mfutselaar commented 9 years ago

Also, while you're at it (or not), before it broke, generated resources still extended Controller, you might want to take that out.

ramon-villain commented 9 years ago

Which version are you using?

mfutselaar commented 9 years ago

The latest development version for 4.3/5.0 (if that's what --dev does)

hannesvdvreken commented 9 years ago

@mfutselaar I guess @ramon-villain wanted to know which version of way/generators you have installed instead.

What --dev does is install the package as a "development" requirement (notice the require and require-dev in your composer.json file). This means that you can deploy your application on production without some require-dev packages by running composer install --no-dev. This could save some time by to not installing all kinds of testing frameworks and development or IDE helpers where you obviously don't need them.

To get the latest development version from master branch, do composer update way/generators:dev-master (replace master with whatever branch), but no need for that, because everything upwards from v3 is already built for Laravel 5.0.x-dev. You can get a stable released version of way/generators by composer update way/generators:~3

For further information, read https://getcomposer.org/doc/02-libraries.md#branches

Hope this helps.

carcinocron commented 9 years ago

@hannesvdvreken for me it is showing way/generators 3.0.3 and using ~3 didn't fix anything.

carcinocron commented 9 years ago

Using 3.0.1 worked.