Class 'Illuminate\Html\HtmlServiceProvider' not found Laravel 5

前端 未结 12 1968
情话喂你
情话喂你 2020-11-30 04:31

I\'m trying to add the HtmlServiceProvider with Laravel 5.

I keep getting the following error:

FatalErrorException in compiled.php line 6391:

相关标签:
12条回答
  • 2020-11-30 05:10

    Root of the error is the alias of the HtmlServiceProvider. In config/app.php under 'aliases' change the alias (Html) case to upper case

    from: 'Html' => 'Illuminate\Html\HtmlFacade'

    to: 'HTML' => 'Illuminate\Html\HtmlFacade'

    0 讨论(0)
  • 2020-11-30 05:11

    Illuminate\Html\HtmlServiceProvider is not a core element anymore. Laravel components that have been removed from the core framework are available on laravelcollective.com your html & forms components can be found here:

    http://laravelcollective.com/docs/5.0/html

    add this to your composer.json :

    "laravelcollective/html": "~5.0"
    

    then update composer:

    composer update
    

    then add providers in config/app.php

    'Collective\Html\HtmlServiceProvider',
    

    and finally add two aliases in the same file:

    'Form' => 'Collective\Html\FormFacade',
    'Html' => 'Collective\Html\HtmlFacade',
    
    0 讨论(0)
  • 2020-11-30 05:14

    Illuminate/HTML package has been deprecated

    Use:laravelcollective/html

    https://stackoverflow.com/a/34991188/3327198

    composer require laravelcollective/html
    

    Add this lines in config/app.php

    in providers group:

    Collective\Html\HtmlServiceProvider::class,
    

    in aliases group:

    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
    
    0 讨论(0)
  • 2020-11-30 05:15

    You can follow below link of Laravel documentation there you can find the solution for all version or Laravel i.e 5.0, 5.1, 5.2, 5.3

    https://laravelcollective.com/docs/5.3/html

    0 讨论(0)
  • 2020-11-30 05:22

    Me I found another cause for this issue:

    in ../Vendor directory sometimes there is a file called "config.php", either delete that file completely or find in there some thing like this line:

    array (
      ...
      28 => 'Illuminate\Html\HtmlServiceProvider',
      ...
    ),
    

    , and remove the line, and then do the "composer update" command, this will help. (It helped me too).

    0 讨论(0)
  • 2020-11-30 05:28

    First add this line to composer.json

    "illuminate/html": "~5.0"
    

    Then do a composer update Wait for the update to finish, then open config/app.php add this:

    'Illuminate\Html\HtmlServiceProvider', 
    

    to the providers array and this:

    'Form'      => 'Illuminate\Html\FormFacade',
    'Html'      => 'Illuminate\Html\HtmlFacade',
    

    to the aliases array, and be sure when you use Html in blade or wherever use it in lowercase 'Html' not HTML

    Here is a reference link: http://thegeekyland.blogspot.com/2015/11/class-illuminatehtmlhtmlserviceprovider.html

    0 讨论(0)
提交回复
热议问题