Laravel Form Class Not Found - Solved

By Hardik Savani April 16, 2024 Category : Laravel

Hi Developer,

This tutorial is focused on laravel class 'form' not found. I’m going to show you about class 'form' not found laravel. I would like to share with you class "form" not found in laravel 9. you can understand a concept of laravelcollective/html laravel.

You can use this example with laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 versions.

Few days ago, i was working on my laravel application and i used Form class on blade file. i got "'Form' Class not found" in laravel. I know why this error comes and i know what i need to do. so we need to install laravelcollective/html composer package to solve this error.

laravelcollective/html is provide html textbox, drop down, radio button, select box, checkbox and many more with laravel. They provide different method to use those input fields we need to add this facade class 'collective\html\formfacade' if not added.

Solution:

We need to install laravelcollective/html composer package to use Form class. so let's run the below command.

composer require laravelcollective/html

Optional:

If you are using 5.x version then you need to add below code In config/app.php file.

'providers' => [

...

Collective\Html\HtmlServiceProvider::class,

...

],

'aliases' => [

...

'Form' => Collective\Html\FormFacade::class,

'Html' => Collective\Html\HtmlFacade::class,

...

],

I hope it can help you...

Tags :
Shares