简体   繁体   English

无法在 Laravel 5.1 中安装 Laravelcollective/HTML

[英]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.

相关问题 如何解决有关“ Laravel 5.5中可安装的软件包集(无法安装laravelcollective / html。)的错误。” - How do I can resolve the error regarding "installable set of packages in Laravel 5.5 ( laravelcollective/html couldn't be install. ) Laravel 5.1:未找到Laravelcollective'Form' - Laravel 5.1: Laravelcollective 'Form' not found Laravelcollective/html 在 Laravel 5.5 中不起作用 - Laravelcollective/html not working in Laravel 5.5 Laravel & LaravelCollective HTML/表单错误 - Laravel & LaravelCollective HTML/Forms Error Laravel Laravelcollective / html具有未转义html的textarea - Laravel laravelcollective/html textarea with unescaped html Laravel 5.8中的laravelcollective / html软件包安装问题 - laravelcollective/html package installation issue in Laravel 5.8 是否可以在不使用Laravel应用程序中使用laravelcollective / html命名空间的情况下也验证表单输入? - Can I validate form input also without using the laravelcollective/html namespace in a Laravel application? 无法在Laravel 5.1上使用创建的模型进行身份验证 - Can't authenticate with created model on Laravel 5.1 在Laravel 5.1中无法发布复选框的值 - In Laravel 5.1 Can't post value of checkbox Laravel 5.1:无法上传视频文件 - Laravel 5.1: can't upload a video file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM