Laravel 5 Class 'HTML' not found

前端 未结 14 1631
野性不改
野性不改 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:06

    Anybody who are using laravel 5.* have to use laravelcollective/html because Package illuminate/html is abandoned, you should avoid using it.

    your composer.json file should contain following code in require section(as i am using laravel 5.2 it will be mentioned as 5.2)

    "laravelcollective/html": "5.2.*"
    

    run composer update

    and your config/app.php should contain following code in providers array

    'providers' => [
                           Collective\Html\HtmlServiceProvider::class,
    
    ]
    

    and aliases should contain

    'aliases' => [
    
                    'Form' => Collective\Html\FormFacade::class,
                    'HTML' => Collective\Html\HtmlFacade::class,
    ]
    

    and please note that whatever aliase you mentioned should appear in your code as

    {{HTML::linkAction('MemberController@show', 'view', array($value->id))}}
    

提交回复
热议问题