Q:

Error with named route

Why this simple named route throw in error
Route::get('/', array('as' => 'dashboard', function()
{
    return View::make('hello');
}));

I've also tested with controller instead of callback but always the same, the error is:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

I'm testing the code with PHP 5.4.x, but I don't think it's PHP related, am I missing something? 

A:

This route:
Route::get('/', array('as' => 'dashboard', function()
{
    return View::make('hello');
}));

Will define this URL for you:
http://example.dev/

But to create a link to this route you'll have to 
URL::route('dashboard');

If you need to access your dashboard via
http://example.dev/dashboard

You have to define
Route::get('dashboard', array('as' => 'dashboard', function()
{
    return View::make('hello');
}));

