1

I have problem when install Laravelcollective/HTML in Laravel 5.1 Install laravelcollective/html document. First, I install through 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)

But it's version 5.0 so remove it.

composer remove illuminate/html

And install version 5.1

"require": {
    "laravelcollective/html": "5.1.*"
}

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::class,
    // ...
  ],

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

  '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
M--
  • 25,431
  • 8
  • 61
  • 93
Vĩ Lương
  • 31
  • 1
  • 9

3 Answers3

3

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.

Don't add the below until after doing the composer update.

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

  'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],
Matt Byrnes
  • 361
  • 2
  • 6
0

I got a solution. You can run this command below by composer. It will install laravelcollective/html

composer require laravelcollective/html
Sarower Jahan
  • 1,445
  • 1
  • 13
  • 20
0

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.

Solution:

Removed:

bootstrap/cache/config.php

composer update
zeros-and-ones
  • 4,227
  • 6
  • 35
  • 54