How to Install Illuminate/HTML In Laravel 5

Feb 14, 2015

In Laravel 4 the Illuminate package is included by default. In Laravel 5 If want to use Form or HTML helpers, you have to install Illuminate/HTML otherwise you will see an error stating class 'Form' not found or class 'Html' not found. So here’s is the instruction on how to install Illuminate/HTML in Laravel 5.

First of all add "illuminate/html": "5.0.*@dev" to your composer.json file in the require section and run composer update.
Next up to add aliases and HTML facades and service provider, update your /config/app.php as follows:


'providers' => [
	...
 
	'Illuminate\Html\HtmlServiceProvider',
],
 
'aliases' => [
 
	...
 
	'Form'=> 'Illuminate\Html\FormFacade', 
	'HTML'=> 'Illuminate\Html\HtmlFacade',
],

After that you will have access to the {{ Form::open() }} and other HTML helpers. Use the following command to test it’s working.


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

About author

Prakash Nakrani

Hi, my name is Prakash Nakrani. A freelance web developer and an enthusiast writer. I loves preety much anything about Web, mostly CSS and designs.

 Comments

  1. 七片
    #

    Thanks for every other wonderful post. Where else may just anyone get that kind
    of info in such an ideal method of writing?
    I have a presentation subsequent week, and I’m on the search for such information.

    Reply
  2. #

    Very good website design. I wanted to say that in adding the php syntax in config/app.php, the syntax in laravel 5 app.php is completely different. It ends with class at the end. So the above lines are not working. Even the aliases syntax is different to the code you have written. so the last commands in the console does not work. Thanks

    Reply
    • Jonny Edwards
      #

      Hey Bishal,

      you’ll want to add the aliases as:

      ‘Form’ => Illuminate\Html\FormFacade::class,
      ‘HTML’ => Illuminate\Html\HtmlFacade::class

      and the provider as
      Illuminate\Html\HtmlServiceProvider::class

  3. #

    Hi my family member! I want to say that this
    article is amazing, great written and come with almost all vital infos.
    I’d like to llok extra posts like this .

    Reply

 Write a Comment

You can use basic HTML Markup.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>