Laravel 5.1: Class html does not exist

前端 未结 9 2029
一个人的身影
一个人的身影 2020-12-10 04:38

I am upgrading from 4.2 directly to 5.1 and run into problems with the Html and Form classes.

I followed the upgrade notes, and did

  • add \"laravelcollec
9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 05:17

    I think I have found the solution.

    In your app.php you have declared

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

    While in your View you have called the same class as

    {!! HTML::style('css/bootstrap.min.css') !!}
    

    There is nothing wrong with the packages as the marked answer above but rather difference in capitalization of the word HTML as the previous documentation ver 5.0.*.

    It should be

    'Form'      => Illuminate\Html\FormFacade::class,
    'HTML'      => Illuminate\Html\HtmlFacade::class,
    

提交回复
热议问题