Reputation: 395
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','CourseController@index');
and this is my CourseController:
<?php
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>
<html>
<head>
<title>Hello World</title>
<link rel="stylesheet" type="text/css" href="">
</head>
<body>
<div class="container">
{!! Form::open(array('route' => 'course.store')) !!}
<input type="text"><br>
<input type="password"><br>
{!! Form::close() !!}
</div>
</body>
</html>
and error:
Whoops, looks like something went wrong.
1/1 FatalErrorException in 818f720d4e075893d8198d2b0ff02e25 line 9: Class 'Form' not found
Help me please
Upvotes: 1
Views: 2846
Reputation: 654
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:
'Collective\Html\HtmlServiceProvider',
Next, add these lines to the 'aliases' array:
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
Upvotes: 10