I just started playing around with laravel. First of all, this is the best framework i've came across. Now here is my issue. I am trying to point from routes -> controller -> view
//This is my Controller file
public function index()
{
return View::make('pages', array('name' => 'Taylor'));
}
// This is my Routes File
Route::get('/', 'pagesController@index');
View file => pages.blade.php
This is the error i'm getting.
FatalErrorException in pagesController.php line 19:
Class 'App\Http\Controllers\View' not found
From the error it seems that the problem is that the View
class is not found in the current namespace.
Try this way:
//use the View class from the global namespace
return \View::make('pages', array('name' => 'Taylor'));
or import the View
class at the beginning of the controller's script:
use View;