在 Laravel 5.1 中安装 Laravelcollective/HTML 时出现问题安装 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' => [
// ...
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