Support the ongoing development of Laravel.io →
Configuration Requests

I have Laravel running on a Vagrant virtual server

Basic route works

Route::get('/', function() { return 'Hello World 007'; });

this also works

Route::get('/scotch', function() { return 'Hello my wonderful scotch'; });

but if I try

Route::get('/', 'AlbumsController@index');

then i get an error

I have an AlbumsController.php file with a function index() that return View::make('index')

I have an Album model that extends Eloquent (not really in use yet)

I have an index.blade.php file

how do I debug what is happening on that get?

I also just tried:

Route::get('/create', 'AlbumsController@create');

and that worked, so what is throwing off the index page?

Last updated 2 years ago.
0

What is the error that you get?

Last updated 2 years ago.
0

I get a "Whoops, looks like something went wrong." error page

Last updated 2 years ago.
0

Enable debugging in app/config/app.php (or in the relevant environment folder) and then try again, line 16, switch from false to true. During development you should enable debugging for error messages.

Last updated 2 years ago.
0

If you have two routes with the same URL you could get conflict between those routes.

If you try to use:

Route::get('/', function() { return 'Hello World 007'; });

You need to comment the following route:

Route::get('/', 'AlbumsController@index');

Because you are overlapping the action of the first closure function with the index action of the AlbumsController.

Hope it helps you.

Last updated 2 years ago.
0

I just installed Laravel and faced this issue. Changing my controller function to 'public static ' solved this issue for me. :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

xuamox xuamox Joined 1 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.