UPDATE: It has been pointed out to me that illuminate/html
is no longer supported/maintained, instead, any references to illuminate
below can be replaced with references to collective
instead. (This includes packages, service providers and aliases.) This package is a direct copy of the illuminate/html
package, but is maintained. The package is provided by Laravel Collective.
With the release of Laravel 5 and some of the awesome changes it brings, some of you may have noticed the changes to the HTML and Form Builder packages, the changes being that they have been removed from the core.
While this does slim down the core files, the documentation lacks any mention of how to add these classes back into your application, or even that they still exist.
Adding The HTML Package
The Laravel HTML package can be added to a Laravel application (or any other application using php and composer for that matter) by simply requiring the package in your composer.json
file.
"illuminate/html": "~5.0"
Once required, run a quick composer update
to install the package.
Register Service Providers And Aliases
Now you have the package installed, you can simply add the Service Provider and Aliases to your config/app.php
file.
// config/app.php
'providers' => [
'Illuminate\Html\HtmlServiceProvider'
],
'aliases' => [
'Form' => 'Illuminate\Html\FormFacade',
'HTML' => 'Illuminate\Html\HtmlFacade',
],
And thats it! You can now use the HTML and Form facades as usual. Just remember that blade now requires you to use slightly different tags so that you avoid outputting escaped html. This is done like so:
{!! Form::open(...) !!}
{!! Form::text(...) !!}
And that concludes the method of adding the HTML and Form Builders back into your application.
Feel free to leave any comments you may have!