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

前端 未结 12 1991
情话喂你
情话喂你 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:29

    Run this in cmd

    php artisan  Illuminate\Html 
    

    and then add variables in app.php

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

    The error indicates it can't find the service provider so make sure you do a composer update. If you did do a composer update check your vendor folder to make sure it pulled in the dependency.

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

    Try the following steps Edit your project's composer.json file.

    "require": {
    "laravelcollective/html": "~5.0"
    

    }

    Next, update Composer from the Terminal:

    composer update

    Next, add your new provider to the providers array of config/app.php:

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

    Finally, add two class aliases to the aliases array of config/app.php:

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

    ],

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

    Double check when Updating your composer, whether you're in the right directory

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

    You can also use like this
    Illuminate\Html\HtmlServiceProvider::class, and

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

    For use laravel html helper you need to require dependency in composer.json file and use namespance.For full process follow my blog. http://www.kingpabel.com/laravel-html-helper/

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