How to Install Illuminate/HTML In Laravel 5

Posted (Updated ) in PHP

Laravel 4 contained a Form helpers package called HTML but it was removed from 5 to cut down on cruft. HTML is still available as a first party package though so below are instructions on getting it back.

First require it in:

composer require "illuminate/html":"5.0.*"

Next up add the service provider and aliases. Open /config/app.php and update as follows:

'providers' => [
	...

	'Illuminate\Html\HtmlServiceProvider',
],

'aliases' => [

	...

	'Form'=> 'Illuminate\Html\FormFacade', 
	'Html'=> 'Illuminate\Html\HtmlFacade',
],

That’s it. To confirm it’s working use the following:

php artisan tinker
> Form::text('foo')
"<input name=\"foo\" type=\"text\">"