html: Fresh 5.1+ installation - Class 'Collective\Html\HtmlServiceProvider' not found

Hi,

I made a fresh laravel 5.1+ installtion via laravel new and did the steps required for this package (composer, providers, aliases).

=>

[Symfony\Component\Debug\Exception\FatalErrorException]  
Class 'Collective\Html\HtmlServiceProvider' not found  

Composer require section:

"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "laravelcollective/html": "5.1.*"
},

Any guesses?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 19 (1 by maintainers)

Most upvoted comments

in composer.json->scripts change this:

"pre-update-cmd": [
    "php artisan clear-compiled"
],
"post-update-cmd": [
    "php artisan optimize"
],

for this:

"post-update-cmd": [
    "php artisan clear-compiled",
    "php artisan optimize"
],

@vanisreerehash do you add the class aliases to the aliases array of config/app.php ?

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

FatalErrorException in 4479bc8de6a7c2824192235d15e389f376f539a2.php line 8: Class ‘Form’ not found

Still facing this issue after composer updating and adding htmlServiceprovider in config/app.php laravel 5.2

Thanks @teqizm, removing ‘Collective\Html\HtmlServiceProvider’ from ServiceProvider in config/app.php worked for me.