[英]How do I can resolve the error regarding "installable set of packages in Laravel 5.5 ( laravelcollective/html couldn't be install. )
[英]Can't install Laravelcollective/HTML in Laravel 5.1
我在 Laravel 5.1 Install laravelcollective/html document 中安裝 Laravelcollective/HTML 時遇到問題。 首先,我通過 Composer 安裝:
composer require illuminate/html
消息: Using version ~5.0 for illuminate/html ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev)
但它是 5.0 版所以刪除它。
composer remove illuminate/html
並安裝 5.1 版
"require": {
"laravelcollective/html": "5.1.*"
}
接下來,從終端更新 Composer:
composer update
接下來,將您的新提供程序添加到 config/app.php 的 providers 數組中:
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
最后,在 config/app.php 的 aliases 數組中添加兩個類別名:
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
和消息錯誤:
FatalErrorException in ProviderRepository.php line 146:
Class 'Collective\Html\HtmlServiceProvider' not found
在我運行 composer update 之前,我以某種方式將下面的內容添加到 config/app.php 中,因此它產生了與您遇到的相同的錯誤。
在進行 Composer 更新之前不要添加以下內容。
'providers' => [
// ...
Collective\Html\HtmlServiceProvider::class,
// ...
],
'aliases' => [
// ...
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
// ...
],
我得到了解決方案。 您可以通過 Composer 在下面運行此命令。 它將安裝laravelcollective/html
composer require laravelcollective/html
我的問題是我有一個緩存的配置文件,我無法重新緩存它,因為它是通過 artisan 緩存的,而 artisan 拋出了錯誤。
解決方案:
刪除:
bootstrap/cache/config.php
composer update
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.