Laravel NotFoundHttpException(RouteCollection-> match)

I am new to Laravel and was following a tutorial (https://www.youtube.com/watch?v=Zz_R73eW3OU&list=PL09BB956FCFB5C5FD). I have just installed the latest version of Laravel and am going through the beginning stages of the tutorial. So far (installation, creating a migration) I was doing ok, but now I am stuck at the point of creating new routes.

I have created a controller in app/controllers:

<?php

class Slots_Controller extends Base_Controller{

    public $restful = true;

    public function get_index(){
        return View::make( 'slots.index' );
    }

}

As well as a very minimalist view in the file app/views/slots/index.php

<h1>Slots</h1>

My app/routes file looks like this :

Route::get('/', function()
{
    return View::make('hello');
});

Route::get( '/public/slots', array(
    'uses' => 'slots@index'
) );

I've searched a number of things on the web and here is how far I have come : - i know ideally only the public dir should be in the htdocs, i will be doing that presumably at a further stage of the tutorial. so as of now, my laravel home page is at http://localhost:8888/my_directory.laravel/public/ - i have checked the apache mod-rewrite : it is on and it works well for codeIgniter - i have checked that the .htaccess is as provided by laravel (and as suggested by different posts)

The weird thing is, if i change the routes for the home page like this :

Route::get('/', function()
{
    return 'hello world';
//  return View::make('hello');
});

Nothing changes, i.e. i still get the original welcome page. My understanding is this modification should have simply output "hello world" as the html for the home page.

So it seems that whatever I'm doing in routes.php has no effect whatsoever, as if I was modifying the wrong file or something.

I've spent the most part of an otherwise sunny afternoon on this, any help is much apreciated :)

Thanks,

Tepp

There are many things you are doing wrong here (The best way is to follow the tutorial on Laravel):

  1. In your controller file you are mentioning "Base_Controller", are you sure you have such a file in your controllers directory? (According to my knowledge it should be BaseController)

  2. The Route::get is not defined properly. There are many ways to define a route; however for your case it should be something like this:

    Route::get('slots', array( 'uses' => 'Slots_Controller@get_index' ));

Hope this helps.