I'm new to Laravel, I have a route in my routes.php file like this:
<?php
Route::resource('search', 'SearchController');
?>
and I have the controller app/controllers/SearchController.php that looks like this:
<?php
class SearchController extends \BaseController {
protected $layout = 'layouts.master';
public function create() {}
public function store(){}
public function index(){
return View::make('hello');
}
}
?>
I previously had a controller with unrestful methods name SearchController. I renamed that one to OldSearchController and updated the routes.
and a file hello.php in app/views.
but, whenever I try to access the page via http://localhost/search
, I get the following error:
BadMethodCallException
Method [index] does not exist.
what else needs to be done?