简单的Laravel View :: make()不起作用

Rya*_*ane 6 php laravel laravel-routing

所以我正在学习一些基本的Laravel内容,因为我是PHP新手.我正在按照一个基本的教程,让我把东西打印到一个名为的文件home.blade.php.

我现在称之为的方式如下.

这是我的 routes.php

Route::get('/', array(
    'as' => 'home',
    'uses' => 'HomeController@home'
));
Run Code Online (Sandbox Code Playgroud)

这是我的 HomeController.php

class HomeController extends Controller {

    public function home() {
        return View::make('home');
    }

}
Run Code Online (Sandbox Code Playgroud)

这是 home.blade.php

{{'Hello.'}}
Run Code Online (Sandbox Code Playgroud)

在你问之前,是的,我的home.blade.php在我的Views文件夹中.

打印错误如下

FatalErrorException in HomeController.php line 6:
Class 'App\Http\Controllers\View' not found
in HomeController.php line 6
at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Class 'App\Http\Controllers\View' not found', 'file' => '/Users/ryandushane/Google Drive/Web_WorkSpace/theNeonSurf/app/Http/Controllers/HomeController.php', 'line' => '6')) in compiled.php line 1738
at HandleExceptions->handleShutdown()
Run Code Online (Sandbox Code Playgroud)

这是奇怪的部分.如果我改变我routes.php只是包含

Route::get('/', function()
{
    return View::make('home');
});
Run Code Online (Sandbox Code Playgroud)

它功能很好.

有谁知道我能做什么?

min*_*noz 13

Laravel 5的新语法

public function home() {
    return view('home');
}
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅http://laravel.com/docs/5.0/views