Class ' Illuminate\html\htmlserviceprovider ' not found or form form does not work correctly with workaround

Source: Internet
Author: User

In the Laravel framework, the form cannot be used properly.

The solutions found on the web are usually consistent, and the following categories are considered:

1, open the root directory Composer.json file, require inside add:

If Laravel is from version 4 to version 5

  "illuminate/html": "~5.0"

Then perform composer update

If it is Laravel5 or later,

Open the command line directly at the site root, run composer require illuminate/html

2, open config/app.php

Add Illuminate\html\htmlserviceprovider::class under Provider,

Add under Aliases

' Form ' = ' illuminate\html\formfacade ',
' Html ' = ' illuminate\html\htmlfacade ',

Once you are done, you can use the From object directly:

For example, the example given in the Laravel document:

{!!   Form::open ([' url ' = = [' Oduct/ajaxfaceimage '], ' method ' = ' POST ', ' id ' = ' upload ', ' files ' = ' = True])!  <a href= "#" class= "btn button-change-profile-picture" > <label for= "upload-profile-picture" > <span Id= "Upload-avatar" > Replace new avatar </span> <input name= "image" id= "image" type= "file" class= "Manual-file-chooser JS -manual-file-chooser Js-avatar-field "> </label> </a>{!! Form::close ()!!}

If there are no other surprises, you should be able to use the form in the template file correctly!!!

Class ' Illuminate\html\htmlserviceprovider ' not found or form form does not work correctly with workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.