0

I have a problem with Laravel Form & HTML. I ran Composer.

composer require illuminate/html

It worked just fine and I added Illuminate\Html\HtmlServiceProvider::class, to my app.php. I also added 'Form' => Illuminate\Html\FormFacade::class, and 'Html'=> Illuminate\Html\HtmlFacade::class, to my aliases but I still get an error.

FatalErrorException in 792badfd9bd1a291ca2af663e544784e7ea6712c.php line 6: Class 'Form' not found

Karl Hill
  • 12,937
  • 5
  • 58
  • 95
user259584
  • 65
  • 1
  • 7

2 Answers2

1

Better would be to use https://laravelcollective.com/ since the illuminate/html is deprecated.

Ozan Kurt
  • 3,731
  • 4
  • 18
  • 32
0

Form is not a class in Illuminate\Html. You're probably looking for FormBuilder.

Ben Harold
  • 6,242
  • 6
  • 47
  • 71
  • He is adding an alias as Facade. – Ozan Kurt Jan 11 '16 at 17:58
  • Hmmm...the way the question is worded I assumed he was attempting to use `Illuminate\Html` in a composer project without Laravel. If he is using `Laravel`, shouldn't `Form` be available by default? – Ben Harold Jan 11 '16 at 18:04
  • Well, facade's refer to an accessor which will refer to a short name that will be registered in the service provider so that laravel can save it in it's container for static calls. If you were to check the service provider it contains a binding between the value from `getFacadeAccessor` method of the facade and the FormBuilder class. – Ozan Kurt Jan 11 '16 at 18:07