Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switching from Illuminate\Html to Collective\Html, Class 'Illuminate\Html\HtmlServiceProvider' not found

I updated composer.json to remove illuminate\html and add:

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

I removed the providers/aliases from app.php for Illuminate\Html and added the replacements:

    Collective\Html\HtmlServiceProvider::class,

...

    'Form'      => Collective\Html\FormFacade::class,
    'Html'      => Collective\Html\HtmlFacade::class,

However when running composer update I receive the output:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing illuminate/html (v5.0.0)

- Installing laravelcollective/html (v5.1.4)
  Downloading: 100%  

Writing lock file
Generating autoload files
> php artisan clear-compiled
PHP Fatal error:  Class 'Illuminate\Html\HtmlServiceProvider' not found in vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 648

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

Script php artisan clear-compiled handling the post-update-cmd event returned with an error

[RuntimeException]                                                                   
Error Output: PHP Fatal error:  Class 'Illuminate\Html\HtmlServiceProvider' not found in vendor/laravel/framework/src/Illuminate/Foundation/Application.php on line 648 

I tried updating composer.json scripts as suggested here: https://github.com/LaravelCollective/html/issues/54

But I'm still receiving the error. Any help is greatly appreciated :)

like image 678
Dylan Avatar asked Aug 29 '15 07:08

Dylan


1 Answers

In the end I managed to fix this with some help on IRC (thanks sisve) and these commands. First I rolled back to a working site with illuminate/html. Then:

composer dumpautoload
composer clearcache
php artisan clear-compiled

If the clear-compiled fails then make sure there are no references to Illuminate\Html in bootstrap/cache/config.php and run it again.

Remove all references to Illuminate\Html in config/app.php
Remove the illuminate/html require in composer.json

composer update

Add the laravelcollective/html package as described here: http://laravelcollective.com/docs/5.1/html#installation

composer update
like image 95
Dylan Avatar answered Nov 19 '22 21:11

Dylan