In Laravel 5 earlier versions, Laravel Form builder was already installed, but on new Laravel versions it is not preinstalled. SO whenever you add Form builder in blade file, you will get error 'Class Form not found'.
To use Laravel Form builder first you have to install laravelcollective/html to project through Composer.
Put the below lines in composer.json
"require": {
"laravelcollective/html": "^6.0"
},
and Run command
composer update
or directly install using command
composer require laravelcollective/html
This will install Laravel Form builder package to use in blade file.
Now open config/app.php file and put the below line in 'providers' array.
'providers' => [
// ...
'Collective\Html\HtmlServiceProvider',
// ...
],
In the same file add these two class aliases in aliases array.
'aliases' => [
// ...
'Form' => 'Collective\Html\FormFacade',
'Html' => 'Collective\Html\HtmlFacade',
// ...
],
Now, you can use of laravel form builder in your blade file.
{!! Form::open(['url' => 'foo/bar']) !!}
// ...
{!! Form::close() !!}
I hope it will help you.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Laravel 8 - How to Restrict or Block User Access via IP Address
In this article, I will share with you h...How to Upload Multiple Files & Images in PHP 7 with MySql Example
In this tutorial, we will learn how to u...Authenticate Users With Node ExpressJS and Passport.js
Today, Node Js one of the most popular l...How to refresh a page with jQuery
Use the JavaScript Met...Node.js MySQL Create Database into Database Server
In the previous article, we have seen ho...