Laravel 5 Class 'HTML' not found

前端 未结 14 1580
野性不改
野性不改 2020-12-10 01:03

I am attempting to use Laravel 5 but my {{ HTML::style(\'style.css\') }} No longer works.

I have updated composer.json to include \"illuminate/ht

相关标签:
14条回答
  • 2020-12-10 01:31

    In the Laravel 5 "illuminate/html": "5.*" is deprecated and replaced with new dependency "laravelcollective/html": "~5.0"

    Begin by installing this package through Composer. Edit your project's composer.json file to require "laravelcollective/html"

    In your composer.json file update the following:

    "require": {
       "laravelcollective/html": "~5.0"
    }
    

    Next, update Composer from the Terminal:

    composer update
    

    Next, add your new provider to the providers array of config/app.php:

    'providers' => [
     // ...
     'Collective\Html\HtmlServiceProvider',
     // ...
    ],
    

    Finally, add two class aliases to the aliases array of config/app.php:

    'aliases' => [
     // ...
       'Form' => 'Collective\Html\FormFacade',
       'Html' => 'Collective\Html\HtmlFacade',
     // ...
    ],
    

    You can also check it here for Laravel 5

    https://laravelcollective.com/docs/5.0/html

    0 讨论(0)
  • 2020-12-10 01:33

    'HTML'=> 'Illuminate\Html\HtmlFacade'

    should be

    'Html'=> 'Illuminate\Html\HtmlFacade'

    0 讨论(0)
提交回复
热议问题