大家好我的形式问题我正在编写html表单,但错误 这是我的路线代码
Route::get('course','CourseController@index');
这是我的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');
}
这是我的观点课程/ 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>
和错误:
Whoops, looks like something went wrong.
1/1 FatalErrorException in 818f720d4e075893d8198d2b0ff02e25 line 9: Class 'Form' not found
请帮帮我
答案 0 :(得分:10)
使用Laravel 5. * Form
&amp; Html
已被弃用。查看uprade guide(搜索Form & HTML Helpers
)。
<强> 1。安装laravelcollective/html
作曲家需要laravelcollective / html
<强> 2。添加Form
和HTML
外观和服务提供商。
修改config/app.php
并将此行添加到'providers'数组:
'Collective\Html\HtmlServiceProvider',
接下来,将这些行添加到'aliases'数组中:
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',