Laravel 5.1: Class html does not exist

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

    Add in composer.json

     "illuminate/html": "5.*"
    

    and run composer update

    Open your config/app.php

    add under 'providers'

    Illuminate\Html\HtmlServiceProvider::class,
    

    add under 'aliases'

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

    and under your blade templates, use as such

    {!! HTML::style('assets/css/flatten.css') !!}
    

提交回复
热议问题