DEV Community

Techsolutionstuff
Techsolutionstuff

Posted on • Originally published at techsolutionstuff.com

Laravel 8 Form Class Not Found

In this article, we will solve laravel 8 form class not found error, many times we have received errors like laravel 8 class 'form' not found.

We have received this error message because the laravel 8 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 a different methods to use those input fields we need to add this facade class 'collective\html\form\facade' if not added. Using the below command you can install the latest and supported version of "laravel collective html"

So, let's see class form not found in laravel 8, laravel 8 class 'form' not found, class 'collective\html\form\facade' not found, laravel collective/html

For laravel 8 form class not found run below command.

composer require laravelcollective/html
Enter fullscreen mode Exit fullscreen mode

Read Also : How to Get Current URL in Laravel


If you are using 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,
      ...
  ],
Enter fullscreen mode Exit fullscreen mode

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

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

composer require "laravelcollective/html":"^5.8.0"
Enter fullscreen mode Exit fullscreen mode

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

'providers' => [
    // ...
    Collective\Html\HtmlServiceProvider::class,
    // ...
  ],
Enter fullscreen mode Exit fullscreen mode

Read Also : Google Line Chart Example in Laravel 8


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,
    // ...
  ],
Enter fullscreen mode Exit fullscreen mode

You might also like :

Top comments (0)