Laravel 5.1: Class html does not exist

前端 未结 9 2028
一个人的身影
一个人的身影 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:33

    My solution in my case it was problem with CASE-Sensitive class name.

    In my config/app.php (in aliases)
    'Form'      => Collective\Html\FormFacade::class,
    'Html'      => Collective\Html\HtmlFacade::class,
    

    I am tried to use in view this code:

    {!! HTML::mailto('mailto:example@example.com', 'example@example.com'); !!}
    

    and that was an error:

    "FatalErrorException in ccf70b1d0b9930d6c4e8f3859fff448f line 11: Class 'HTML' not found"
    

    Name of class 'HTML' is CASE-Sensitive. You should use 'Html' as in your config (config/app.php) file.

    Hope this help for some people.

提交回复
热议问题