Jonh Doe
Jonh Doe

Reputation: 761

Laravel 5 Home Controller MIssing

I checked controller.php in Laravel 5 and it only has a base controller. In Laravel 4 you also have a home controller. Is the home controller removed in Laravel 5?

Upvotes: 2

Views: 4607

Answers (1)

Jilson Thomas
Jilson Thomas

Reputation: 7303

L5 comes with no HomeController like previous versions. But, you can create a new controller using the command

php artisan make:controller HomeController

or you can manually create one. But make sure you are extending the Controller.php class.

eg:

<?php

namespace App\Http\Controllers;

use App\Http\Requests;
use Illuminate\Http\Request;

class HomeController extends Controller
{

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home');
    }
}

Upvotes: 8

Related Questions