Reputation: 541
I am watching a series on tutsplus about building a real application with Laravel. The series was created last year. I assume it was for Laravel 3.
There were a lot of changes I assume and I found out most of them so far and replaced it from the old code. But I can not figure this one out.
In the following code, I get the error ReflectionException - Class questions does not exist
even though the class I know is there. I did try composer update and auto-dumb but same output.
I assume there is something wrong with ether of these files:
Code:
QuestionsController.php
class QuestionsController extends BaseController {
public $restful = true;
public function get_index() {
return View::make('questions.index')
->with('title', 'Make it snappy Q&A - Home');
}
}
Route.php:
Route::get('/', array(
'as' => 'home',
'uses' => 'questions@index'
));
Why does it give an error?
Upvotes: 0
Views: 1149
Reputation: 1478
that should work
Route::get('/', array(
'as' => 'home',
'uses' => 'QuestionsController@get_index'
));
Upvotes: 4