[英]Can't install Laravelcollective/HTML in Laravel 5.1
I have problem when install Laravelcollective/HTML in Laravel 5.1 Install laravelcollective/html document .我在 Laravel 5.1 Install laravelcollective/html document 中安装 Laravelcollective/HTML 时遇到问题。 First, I install through Composer:
首先,我通过 Composer 安装:
composer require illuminate/html
Message: Using version ~5.0 for illuminate/html ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)
消息:
Using version ~5.0 for illuminate/html ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)
But it's version 5.0 so remove it.但它是 5.0 版所以删除它。
composer remove illuminate/html
And install version 5.1并安装 5.1 版
"require": {
"laravelcollective/html": "5.1.*"
}
Next, update Composer from the Terminal:接下来,从终端更新 Composer:
composer update
Next, add your new provider to the providers array of config/app.php:接下来,将您的新提供程序添加到 config/app.php 的 providers 数组中:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
Finally, add two class aliases to the aliases array of config/app.php:最后,在 config/app.php 的 aliases 数组中添加两个类别名:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
And message error:和消息错误:
FatalErrorException in ProviderRepository.php line 146:
Class 'Collective\Html\HtmlServiceProvider' not found
Before I ran composer update, I had somehow added to config/app.php the below and thus it generated the same error you were getting.在我运行 composer update 之前,我以某种方式将下面的内容添加到 config/app.php 中,因此它产生了与您遇到的相同的错误。
Don't add the below until after doing the composer update.在进行 Composer 更新之前不要添加以下内容。
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
I got a solution.我得到了解决方案。 You can run this command below by composer.
您可以通过 Composer 在下面运行此命令。 It will install
laravelcollective/html
它将安装
laravelcollective/html
composer require laravelcollective/html
My problem was I had a cached config file, I could not re-cache it since it gets cached via artisan and artisan was throwing the error.我的问题是我有一个缓存的配置文件,我无法重新缓存它,因为它是通过 artisan 缓存的,而 artisan 抛出了错误。
Solution:解决方案:
Removed:删除:
bootstrap/cache/config.php
composer update
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.