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
How to add Pagination in Laravel 11 Livewire
How to add Pagination in Larav...

Hello, laravel web developers! This article will show how to add pagination in laravel 11 Livewire. Here, we'll...

Read More

Jun-14-2024

How to Get Selected Checkbox Value in Array Using jQuery
How to Get Selected Checkbox V...

In this post we will see how to get selected checkbox value in array using jquery. Here i will give you some example to&...

Read More

May-24-2021

How to Use Laravel Factory in Seeder
How to Use Laravel Factory in...

Laravel is a popular PHP framework known for its elegance and simplicity in building web applications. When it comes to...

Read More

Sep-13-2023

How To Two Factor Authentication Using Email In Laravel 10
How To Two Factor Authenticati...

In this article, we will see how to two-factor authentication using email in laravel 10. Here, we will learn about...

Read More

Apr-14-2023