There seems to be a mistake in creating the controllers.
I checked it a minute ago using Laravel 5, which I installed in about a week or two, and it worked fine. But when I installed the new Laravel 5, now the controllers are created in the app/ folder, and not in app/Http/Controllers .
But itβs also possible that the developers changed their minds where the controllers will be stored (Laravel 5 is still under development).
No one currently knows this, you can also watch the Laracast discussion about this issue.
It is also strange that you cannot manually add the path to this command.
In Laravel 4 you can do:
php artisan controller:make --path="app/Controllers" PagesController
but in Laravel5 for controller:make you have fewer options compared to Laravel 4, they are:
Options: --plain Generate an empty controller class. --help (-h) Display this help message. --quiet (-q) Do not output any message. --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug --version (-V) Display this application version. --ansi Force ANSI output. --no-ansi Disable ANSI output. --no-interaction (-n) Do not ask any interactive question. --env The environment the command should run under.
therefore, you cannot put your own path here or create some methods, as you can in Laravel 4.
EDIT
It seems to work again, as in the latest Laravel 5 commit. Therefore, you must either create a new Laravel 5 project or run:
composer update
to update the project.
However, you will probably get some errors, for example:
{"error": {"Type": "Symfony \ Component \ Debug \ Exception \ FatalErrorException", "message": "Class 'Illuminate \ Routing \ FilterServiceProvider' not found", "file":
To remove these errors:
in the file app/Providers/FilterServiceProvider.php change
use Illuminate\Routing\FilterServiceProvider as ServiceProvider;
in
use Illuminate\Foundation\Support\Providers\FilterServiceProvider as ServiceProvider;
and in the file in the file app/Providers/RouteServiceProvider.php change
use Illuminate\Routing\RouteServiceProvider as ServiceProvider;
in
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;