从Illuminate \ Html切换到Collective \ Html,找不到"Illuminate \ Html \ HtmlServiceProvider"类 [英] Switching from Illuminate\Html to Collective\Html, Class 'Illuminate\Html\HtmlServiceProvider' not found
问题描述
我更新了composer.json
以删除illuminate \ html并添加:
I updated composer.json
to remove illuminate\html and add:
"require": {
"laravelcollective/html": "5.1.*"
我从app.php
中删除了Illuminate \ Html的提供程序/别名,并添加了替换项:
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,
但是,当运行composer update
时,我会收到输出:
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
我尝试按照此处的建议更新composer.json
脚本: https://github.com/LaravelCollective /html/issues/54
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 :)
推荐答案
最后,我设法在IRC(感谢sisve)和这些命令上提供了一些帮助来解决此问题.首先,我使用illuminate/html回滚到一个工作站点.然后:
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
如果clear-compiled
失败,请确保在bootstrap/cache/config.php
中没有对Illuminate \ Html的引用,然后再次运行.
If the clear-compiled
fails then make sure there are no references to Illuminate\Html in bootstrap/cache/config.php
and run it again.
在config/app.php
中删除对Illuminate \ Html的所有引用
删除composer.json
Remove all references to Illuminate\Html in config/app.php
Remove the illuminate/html
require in composer.json
composer update
按此处所述添加laravelcollective/html包: http://laravelcollective.com/docs/5.1/html#installation
Add the laravelcollective/html package as described here: http://laravelcollective.com/docs/5.1/html#installation
composer update
这篇关于从Illuminate \ Html切换到Collective \ Html,找不到"Illuminate \ Html \ HtmlServiceProvider"类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!