I'm trying to learn how to use Laravel 5, but I've bumped into a problem. I've created the following code so far:
under app/HTTP/routes.php:
<?php
Route::get('/', 'MyController@home');
Created my own MyController.php file under app\Http\Controllers and added the following code to the controller:
<?php
namespace App\Http\Controllers;
use Illuminate\Routing\Controller as BaseController;
class MyController extends BaseController
{
public function home()
{
$name = "John Doe";
return View::make("index")->with("name", $name);
}
}
When I run the app I get the error:
FatalErrorException in MyController.php line 12:
Class 'App\Http\Controllers\View' not found
What am I doing wrong?