Laravel 9 Form Class Not Found

Websolutionstuff | Sep-19-2022 | Categories : Laravel

In this article, we will fix the laravel 9 form class not found error, many times we have received errors like laravel 9 class 'form' not found. The Laravel Collective package HTML comes packed with an HTML and FORM generator allowing you to handle easy-to-manage forms in your blade files as well as intricate model binding to your forms.

We have received this error message because of laravel 9 version made changes in their library file, you can solve this issue by using the "laravelcollective/html" package. laravelcollective/html package will provide you with HTML and FORM class helper.

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

So, let's see the class 'form' not found in laravel 9 and how to install laravel collective in laravel 9.

For the laravel 9 form class not found run the below command and install the latest and supported version of "laravelcollective html".

composer require laravelcollective/html

 

 

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

'providers' => [
    ...
    Collective\Html\HtmlServiceProvider::class,
    ...
  ],
'aliases' => [
      ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
      ...
  ],

 

If you are using a lower laravel collective version like v5.6, v5.5, or below then add code like the below.

Goto your project's composer.json file to require laravelcollective/html.

composer require "laravelcollective/html":"^5.8.0"

 

Now, add your new provider to the provider's array of config/app.php :

'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],

 

After that, add two class aliases to the aliases array of config/app.php

'aliases' => [
    // ...
      'Form' => Collective\Html\FormFacade::class,
      'Html' => Collective\Html\HtmlFacade::class,
    // ...
  ],

 

 

If you can use greater than the v5.6 version then we just need to run single command no other changes are required in any files.

$ composer require laravelcollective/html

 


You might also like :

Recommended Post
Featured Post
Laravel mix is not recognized as an internal or external command
Laravel mix is not recognized...

Greetings, developers! If you've encountered the frustrating "Laravel Mix is not recognized as an internal...

Read More

Dec-29-2023

How To Bind Data In React JS
How To Bind Data In React JS

In this article, we will see how to bind data in React JS. Also, we will see how to bind the variable value in the...

Read More

Aug-19-2022

Convert JSON String to JSON Object Javascript
Convert JSON String to JSON Ob...

In this example we will see convert JSON string to JSON object in Javascript. You can use the javascript JSON.parse...

Read More

Jul-14-2021

Laravel 9 Ajax File Upload With Progress Bar
Laravel 9 Ajax File Upload Wit...

In this article, we will see the laravel 9 ajax file upload with a progress bar. we will learn how to file upload using...

Read More

Nov-15-2022