本文介绍了类'Illuminate \Html\HtmlServiceProvider'未找到Laravel 5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图添加HtmlServiceProvider与Laravel 5.
我不断得到以下错误:



在compile.php行6391 FatalErrorException
类'Illuminate \Html\HtmlServiceProvider'未找到



这是我的提供者的样子:

 'providers'=> [

/ *
* Laravel框架服务提供商...
* /
'Illuminate \Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate \Bus\BusServiceProvider',
'Illuminate \Cache\CacheServiceProvider',
'Illuminate \Foundation\Providers \ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate \Cookie\CookieServiceProvider',
'Illuminate \Database\DatabaseServiceProvider',
'Illuminate \Encryption\EncryptionServiceProvider',
'Illuminate \Filesystem\FilesystemServiceProvider',
'Illuminate \Foundation\Providers\FoundationServiceProvider',
'Illuminate \ Hashing\HashServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate \Pagination\PaginationServiceProvider',
'Illuminate \Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate \Auth\ Passwords \ PasswordStetServiceProvider',
'Illuminate \\ \\ Session\SessionServiceProvider',
'Illuminate \Translation\TranslationServiceProvider',
'Illuminate \Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
'Illuminate \Html\HtmlServiceProvider',

/ *
*应用程序服务提供商...
* /
'App\Providers \\ \\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',

],

是我的别名看起来ik app.php:

 'aliases'=> [

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

],

最后我添加了这里我的composer.json

 require:{
laravel / framework 5.0。*,
illuminate / html:〜5.0
},


$ b b

不知怎的,我不断收到这个错误,所以希望有人可以帮助我:)



提前感谢!

解决方案

首先将此行添加到 composer.json

 illuminate / html:〜5.0

然后执行 composer更新
等待更新完成,然后打开 config / app.php add this:

 'Illuminate\Html\HtmlServiceProvider',
/ pre>

providers 数组和:

 'Form'=> 'Illuminate\Html\FormFacade',
'Html'=> '别名 code>数组,并确保在刀片式服务器中使用Html或在小写Html而不是HTML中使用Html



这里是一个参考链接:


Im trying to add the HtmlServiceProvider with Laravel 5. I keep getting the following error:

FatalErrorException in compiled.php line 6391: Class 'Illuminate\Html\HtmlServiceProvider' not found

This is how my providers look like:

'providers' => [

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

    /*
     * Application Service Providers...
     */
    'App\Providers\AppServiceProvider',
    'App\Providers\BusServiceProvider',
    'App\Providers\ConfigServiceProvider',
    'App\Providers\EventServiceProvider',
    'App\Providers\RouteServiceProvider',

],

This is how my aliases look ik app.php:

'aliases' => [

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

],

At last i have added this inside my composer.json

"require": {
    "laravel/framework": "5.0.*",
    "illuminate/html": "~5.0"
},

Somehow i keep getting this error so im hoping someone can help me out with this :)

Thanks in advance!

解决方案

First add this line to composer.json

"illuminate/html": "~5.0"

Then do a composer updateWait for the update to finish, then open config/app.php add this:

'Illuminate\Html\HtmlServiceProvider',

to the providers array and this:

'Form'      => 'Illuminate\Html\FormFacade',
'Html'      => 'Illuminate\Html\HtmlFacade',

to the aliases array, and be sure when you use Html in blade or wherever use it in lowercase 'Html' not HTML

Here is a reference link: http://thegeekyland.blogspot.com/2015/11/class-illuminatehtmlhtmlserviceprovider.html

这篇关于类'Illuminate \Html\HtmlServiceProvider'未找到Laravel 5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 06:28