Laravel:" Class' Illuminate \ Html \ HtmlServiceProvider'找不到"终端错误

时间:2015-08-08 03:05:09

标签: laravel-5.1

我读到"illuminate/html": "5.*",已不再维护,所以我认为我应该进入此问题:http://laravelcollective.com/docs/5.1/html

当我尝试通过composer update更新作曲家时出现错误,它说

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

我无法理解造成这种情况的原因。

我的composer.json需要部分

  "require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "barryvdh/laravel-ide-helper": "^2.0",
    "laravelcollective/html": "^5.1"
  },    

app.php提供商部分

'providers' => [

        /*
         * Laravel Framework Service Providers...
         */
        Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
        Illuminate\Auth\AuthServiceProvider::class,
        Illuminate\Broadcasting\BroadcastServiceProvider::class,
        Illuminate\Bus\BusServiceProvider::class,
        Illuminate\Cache\CacheServiceProvider::class,
        Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
        Illuminate\Routing\ControllerServiceProvider::class,
        Illuminate\Cookie\CookieServiceProvider::class,
        Illuminate\Database\DatabaseServiceProvider::class,
        Illuminate\Encryption\EncryptionServiceProvider::class,
        Illuminate\Filesystem\FilesystemServiceProvider::class,
        Illuminate\Foundation\Providers\FoundationServiceProvider::class,
        Illuminate\Hashing\HashServiceProvider::class,
        Illuminate\Mail\MailServiceProvider::class,
        Illuminate\Pagination\PaginationServiceProvider::class,
        Illuminate\Pipeline\PipelineServiceProvider::class,
        Illuminate\Queue\QueueServiceProvider::class,
        Illuminate\Redis\RedisServiceProvider::class,
        Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
        Illuminate\Session\SessionServiceProvider::class,
        Illuminate\Translation\TranslationServiceProvider::class,
        Illuminate\Validation\ValidationServiceProvider::class,
        Illuminate\View\ViewServiceProvider::class,
        Collective\Html\HtmlServiceProvider::class,

app.php alisases部分

'aliases' => [
'App'       => Illuminate\Support\Facades\App::class,
'Artisan'   => Illuminate\Support\Facades\Artisan::class,
'Auth'      => Illuminate\Support\Facades\Auth::class,
'Blade'     => Illuminate\Support\Facades\Blade::class,
'Bus'       => Illuminate\Support\Facades\Bus::class,
'Cache'     => Illuminate\Support\Facades\Cache::class,
'Config'    => Illuminate\Support\Facades\Config::class,
'Cookie'    => Illuminate\Support\Facades\Cookie::class,
'Crypt'     => Illuminate\Support\Facades\Crypt::class,
'DB'        => Illuminate\Support\Facades\DB::class,
'Eloquent'  => Illuminate\Database\Eloquent\Model::class,
'Event'     => Illuminate\Support\Facades\Event::class,
'File'      => Illuminate\Support\Facades\File::class,
'Hash'      => Illuminate\Support\Facades\Hash::class,
'Input'     => Illuminate\Support\Facades\Input::class,
'Inspiring' => Illuminate\Foundation\Inspiring::class,
'Lang'      => Illuminate\Support\Facades\Lang::class,
'Log'       => Illuminate\Support\Facades\Log::class,
'Mail'      => Illuminate\Support\Facades\Mail::class,
'Password'  => Illuminate\Support\Facades\Password::class,
'Queue'     => Illuminate\Support\Facades\Queue::class,
'Redirect'  => Illuminate\Support\Facades\Redirect::class,
'Redis'     => Illuminate\Support\Facades\Redis::class,
'Request'   => Illuminate\Support\Facades\Request::class,
'Response'  => Illuminate\Support\Facades\Response::class,
'Route'     => Illuminate\Support\Facades\Route::class,
'Schema'    => Illuminate\Support\Facades\Schema::class,
'Session'   => Illuminate\Support\Facades\Session::class,
'Storage'   => Illuminate\Support\Facades\Storage::class,
'URL'       => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View'      => Illuminate\Support\Facades\View::class,
'Form'      => Collective\Html\FormFacade::class,
'Html'      => Collective\Html\HtmlFacade::class,

],

3 个答案:

答案 0 :(得分:4)

我解决了这个问题,但我不确定这是正确的解决方案。

我在

中的composer.json中更改了这些内容
"pre-update-cmd": [
    "php artisan clear-compiled"
],
"post-update-cmd": [
    "php artisan optimize"
],

到这个

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

来源:https://github.com/LaravelCollective/html/issues/54#issuecomment-127351058

答案 1 :(得分:2)

请参阅接受的答案here;你需要先添加

"illuminate/html": "~5.0"

到composer.json做一个

composer update

然后修改app.php

答案 2 :(得分:0)

您也可以运行

Composer install