Laravel 5.2,LaravelCollective 5.2,Class';Html';找不到
我遵循了这些步骤,但仍然没有找到“Html”类 添加到Laravel 5.2,LaravelCollective 5.2,Class';Html';找不到,laravel,laravel-5.2,illuminate-container,laravelcollective,Laravel,Laravel 5.2,Illuminate Container,Laravelcollective,我遵循了这些步骤,但仍然没有找到“Html”类 添加到composer.json "require": { "laravelcollective/html": "5.2.*" } 安装后,在config/app.php 'providers' => [ // ... Collective\Html\HtmlServiceProvider::class, // ... ], 'aliases' => [ // ...
composer.json
"require": {
"laravelcollective/html": "5.2.*"
}
安装后,在config/app.php
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
请参阅附加的屏幕截图。原因可能是什么,我也尝试了composer dump autoload
composer clear cache
,但没有解决问题
已更新
查看示例代码
{!!Html::style('assets/css/bootstrap.min.css')!!}
{!!Html::style('assets/css/custom.css')!!}
{!!Html::script('assets/js/jquery.min.js')!!}
{!!Html::script('assets/js/bootstrap.min.js')!!}
我刚刚在这里找到了解决方案,它非常有效 遵循这些步骤
composer require laravelcollective/html
它将根据您安装的Laravel版本(mine 5.2)安装html
&form
)
添加了提供者和别名
composer require laravelcollective/html
在providers
array add中打开config/app.php
Collective\Html\HtmlServiceProvider::class
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class
在别名中添加
Collective\Html\HtmlServiceProvider::class
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class
在此处找到解决方案
堆栈溢出
你能详细说明一下“一旦安装”吗?您是否运行了composer update
?您是否也可以显示视图文件?可能是@patricus的重复项,但不是重复项,因为我要求的是Laravel 5.2版本,您提到的链接是针对Laravel 5.1的,因此,请不要重复此处发布的解决方案与您在问题中所说的解决方案有什么不同?在composer.json
中添加程序包和运行composer require
命令时,会有更大的不同。我不相信这与您的问题有任何关系。我看到你更新了你的问题,以纠正刀片代码中的外壳。这是您问题中的一个输入错误,还是您在所有大写字母中都使用了HTML
?好的,正如我所怀疑的,您将其添加到了composer.json
,但实际上您并没有通过composer update
安装它composer require
基本上是在后台进行更新。@patricus我在windows plate farm(windows 10)未找到类Html时仍然遇到相同的错误
您有什么建议吗?