从Illuminate\Html切换到Collective\Html,未找到类'Illuminate\Html\HtmlServiceProvider'

Dyl*_*lan 7 laravel laravel-5 laravel-5.1 laravelcollective

我更新composer.json了删除illuminate\html并添加:

"require": {
    "laravelcollective/html": "5.1.*"
Run Code Online (Sandbox Code Playgroud)

我从app.phpIlluminate\Html中删除了提供者/别名并添加了替换:

    Collective\Html\HtmlServiceProvider::class,
Run Code Online (Sandbox Code Playgroud)

...

    'Form'      => Collective\Html\FormFacade::class,
    'Html'      => Collective\Html\HtmlFacade::class,
Run Code Online (Sandbox Code Playgroud)

但是在运行时composer update我会收到输出:

$ 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 
Run Code Online (Sandbox Code Playgroud)

我尝试composer.json按照此处的建议更新脚本:https://github.com/LaravelCollective/html/issues/54

但我仍然收到错误.任何帮助是极大的赞赏 :)

Dyl*_*lan 13

最后,我设法通过IRC(感谢sisve)和这些命令提供了一些帮助.首先,我使用illuminate/html回滚到工作站点.然后:

composer dumpautoload
composer clearcache
php artisan clear-compiled
Run Code Online (Sandbox Code Playgroud)

如果clear-compiled失败,则确保没有对Illuminate\Html的引用bootstrap/cache/config.php并再次运行它.

删除对config/app.php
删除illuminate/html要求中的所有对Illuminate\Html的引用composer.json

composer update
Run Code Online (Sandbox Code Playgroud)

添加laravelcollective/html包,如下所述:http://laravelcollective.com/docs/5.1/html#installation

composer update
Run Code Online (Sandbox Code Playgroud)