In this tutorial you will learn about the Laravel 5 Class ‘form’ not found and its application with practical example.
Laravel 5 Class ‘form’ not found
Back In Laravel 5.4, we were able to directly use laravel form builder. But now in Laravel latest version Form and HTML libraries are not included by default. Now, Form and HTML are now separate composer packages. So to make use of form builder you have to install laravelcollective/html composer package for form in your laravel application.
Install illuminate/html Package
Install illuminate/html Package using following command in terminal at project directory and installation is done as per laravel version:
1 |
composer require "laravelcollective/html" |
Add Service Providers and Alias
Now, open config/app.php file and add service providers and alias:
config/app.php
1 2 3 4 5 6 7 8 9 10 11 12 |
'providers' => [ // ... Collective\Html\HtmlServiceProvider::class, // ... ], 'aliases' => [ // ... 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, // ... ], |
Now, you would be able to make use of laravel form builder.