Laravel 8 Form Class Not Found

Websolutionstuff | Mar-12-2021 | Categories : Laravel

In this small post, we will solve the laravel 8 form class not found error, many time we have received errors like the laravel 8 class 'form' not found

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

laravelcollective/html is provided 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.

Using the below command you can install the latest and supported version of "laravelcollective html"

For laravel 8 form class not found run the below command.

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 or below then add code like 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 providers 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,
    // ...
  ],

 


You might also like:

Recommended Post
Featured Post
Laravel 8 One To Many Relationship Example
Laravel 8 One To Many Relation...

In this example we will see laravel 8 one to many relationship example. Also you can use one to many relationship in lar...

Read More

Nov-03-2021

How To Count Days Excluding Weekends And Holidays In Laravel 9
How To Count Days Excluding We...

In this article, we will see how to count days excluding weekends and holidays in laravel 9. Here, we will learn to...

Read More

Jan-24-2023

How To Fix cURL Error 60 SSL Certificate Problem
How To Fix cURL Error 60 SSL C...

In this example we see how to fix cURL error 60 SSL certificate problem. cURL error 60: SSL certificate proble...

Read More

Dec-08-2021

Laravel whereIn and whereNotIn Query Example
Laravel whereIn and whereNotIn...

In this article, we will see the laravel whereIn and whereNotIn query examples. laravel query builder provides many diff...

Read More

Jan-16-2021