在Laravel工作。我在那里遇到了一个问题。错误消息:找不到类“表单”
我的路线:
Route::get('/h', function () {
return view('Account.hb');
});
Route::get('/h',['uses'=>'AccountController@manageCategory']);
Route::post('/h',['as'=>'add.category','uses'=>'AccountController@addCategory']);
在我的模板中:
{!! Form::open(['route'=>'add.category']) !!}
谢谢。
你有没有为你的项目添加laravelcollective / html?如果不使用此命令添加它:
composer require "laravelcollective/html":"^5.4.0"
然后将此行添加到providers部分中的config / app.php文件中:
Collective\Html\HtmlServiceProvider::class,
并将这些行添加到别名部分中的同一文件中:
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
有关更多信息,请访问this link。
新的laravel没有Form Collective的包。所以在安装时你做不到
{! Form :: open(['route'=>'add.category'])!!}
如果项目已存在且您在本地运行,请确保运行composer install以安装依赖项(如果它包含在composer包中)。
要么
你可以在https://laravelcollective.com/docs/5.4/html中按照这个步骤
你很高兴。