Why my form open not working in laravel 5.1?

- 1 answer


Hi all I have problame with my form I am writing html form but its error and this is my route code

Route::get('course','[email protected]');

and this is my CourseController:


namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class CourseController extends Controller
     * Display a listing of the resource.
     * @return \Illuminate\Http\Response
    public function index()
        return view('course.create');

and this is my view course/create.blade.php

<!DOCTYPE html>
    <title>Hello World</title>
    <link rel="stylesheet" type="text/css" target="_blank" rel="nofollow noreferrer" target="_blank" rel="nofollow noreferrer" href="">
<div class="container">
    {!! Form::open(array('route' => 'course.store')) !!}

        <input type="text"><br>
        <input type="password"><br>
    {!! Form::close() !!}

and error:

Whoops, looks like something went wrong.
1/1 FatalErrorException in 818f720d4e075893d8198d2b0ff02e25 line 9: Class 'Form' not found 

Help me please




With Laravel 5.* the Form & Html have been deprecated. Check out uprade guide (search Form & HTML Helpers).

1. Install laravelcollective/html

composer require laravelcollective/html

2. Add the Form and HTML facades and service provider.

Edit config/app.php and add this line to the 'providers' array:


Next, add these lines to the 'aliases' array:

'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
source: stackoverflow.com