0
votes

I did look at the other Laravel Route questions, but nothing seems to work for me.

I am trying Laravel 4. I ran the command: php artisan controller:make PhotoController

to create my controller. Then I added a route in my routes.php file as such:

Route::resource('photo', 'PhotoController');

When I go to localhost/photo, I see 404 Not Found.

Any ideas? I can see the root and /index.php, they both say "Hello World", so I know something is working.

2
Are you seeing the Laravel 404 page or the Apache / web-server 404 page? I'm thinking this could be a case of htaccess and/or mod-rewrite not being set up correctly. To test this, try loading localhost/index.php/photo - micflan
I'm not familiar with L4's artisan controller-maker, but does the PhotoController have an index function? - Mike Rockétt
@MikeAnthony - yes, it will make a full resful controller with index etc - Laurence

2 Answers

0
votes

You might need to run

composer dumpautoload

from the command line, so laravel knows the controller is there.

-1
votes

you can also try this:

php artisan dump-autoload