Laravel 5 quick-tip: Get the HTML and Form builder back

In Laravel 5 the HTML and Form builder got removed because it shouldn’t be in the core of the framework. I can see their point there, but if you are upgrading your project it would be a lot of work to change all those calls. So I want to get the HTML and form builder back. The Laravel Collective maintains (and improve) packages which are removed from Laravel. The HTML and Form package from them is preferred over the illuminate/html package, because it’s better maintained. So let’s add their package to our Laravel installation.

  1. Open up composer.json and add to the require section:
    "laravelcollective/html": "5.1.*"
  2. Open up config/app.php and add to the providers array:
    /*
     * Package providers
     */
    Collective\Html\HtmlServiceProvider::class,,
  3. In the same file add to the aliases array:
    /*
     * Package aliases
     */
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,,
  4. Run composer update from the command line.

Leave a Reply

Your email address will not be published. Required fields are marked *