Search code examples
laravellaravel-5.3laravel-blade

Class 'Form' not found in Laravel 5.3?


In Laravel 5.2 form class in app.php is:

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

But this code not work in Laravel 5.3.

How to add class Form in Laravel 5.3 ?


Solution

  • Its called the Laravel Collective package and It has been removed from laravel defaults.

    You can still integrate and use it.

    here is the documentation Laravel Collective

    How to Install

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

    Next, add your new provider to the providers array of config/app.php:

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

    Finally, add two class aliases to the aliases array of config/app.php:

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