未找到Laravel-类

未找到Laravel-类,laravel,laravel-4,Laravel,Laravel 4,我正在看一个关于tutsplus的系列节目,内容是关于用Laravel构建一个真正的应用程序。这个系列是去年创作的。我猜是为了拉威尔3号 我假设有很多更改,到目前为止我发现了大部分更改,并将其从旧代码中替换。但我想不出这个 在下面的代码中,我得到一个错误ReflectionException-类问题不存在,即使我知道的类在那里。我确实尝试过composer update和auto dumb,但输出相同 我认为这些文件中的任何一个都有问题: 代码: QuestionsController.php

我正在看一个关于tutsplus的系列节目,内容是关于用Laravel构建一个真正的应用程序。这个系列是去年创作的。我猜是为了拉威尔3号

我假设有很多更改,到目前为止我发现了大部分更改,并将其从旧代码中替换。但我想不出这个

在下面的代码中,我得到一个错误
ReflectionException-类问题不存在
,即使我知道的类在那里。我确实尝试过composer update和auto dumb,但输出相同

我认为这些文件中的任何一个都有问题:

代码:

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'
));
为什么会出现错误?

应该可以

Route::get('/', array(
    'as' => 'home',
    'uses' => 'QuestionsController@get_index'
));
这应该行得通

Route::get('/', array(
    'as' => 'home',
    'uses' => 'QuestionsController@get_index'
));

L4中不再有
$restful
属性,要使用restful控制器,您将使用
Route::controller(“/”,“QuestionsController”)并命名您的方法
getIndex
getsomethingese
postSomethingElse
,等等。L4中不再有
$restful
属性,要使用restful控制器,您将使用
Route::controller(“/”,“questions controller”)并命名方法
getIndex
getSomething
postSomethingElse
,等等。