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