如何在不使用composer的情况下在laravel 5中安装laravelcollective html

问题描述 投票:0回答:2

我正在使用laravel 5.5,我想在不使用composer的情况下安装laravelcollective。我已按照其他问题中提到的步骤将其安装在laravel 5.2中,但它产生以下错误。 Class Collective\Html\HtmlServiceProvider not found

请提出错误的可能原因。

laravel laravel-5.5 laravelcollective
2个回答
1
投票

Shashank Simha M R,我认为最好的方法是通过像这样的作曲家安装它:composer require laravelcollective/html "5.5.*"。在这里,您只需指定已安装的Laravel的版本。否则,composer将无法安装它。

之后,您只需更新config / app.php文件:

  1. 将以下行添加到$provider数组:Collective\Html\HtmlServiceProvider::class
  2. 然后找到别名数组并将这两个别名添加到别名数组:'Form' => Collective\Html\FormFacade::class'Html' => Collective\Html\HtmlFacade::class That is it!

0
投票

转到此链接:

https://github.com/LaravelCollective/html

下载该包并将其解压缩到/ vendor /文件夹,以便您拥有此路径

/vendor/laravelcollective/html/src/HtmlServiceProvider.php

接下来,将您的新提供程序添加到config / app.php的providers数组中:

  'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],

最后,将两个类别名添加到config / app.php的别名数组中:

  'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],

它应该工作。

© www.soinside.com 2019 - 2024. All rights reserved.