Laravel 4 included by default Form helpers package called HTML, but it was removed from Laravel 5. HTML package is still available, but you need to install it with composer. Follow these below instructions to use HTML and Form package again.
Type composer require to add the package to your project. Please note that the HTML package is now supported by LaravelCollective group (“illuminate/html” => “laravelcollective/html”)
composer require "laravelcollective/html" composer update
Open /config/app.php, add provider and aliases:
'providers' => [ # ... Collective\Html\HtmlServiceProvider::class, ], # ... 'aliases' => [ # ... 'Form' => Collective\Html\FormFacade::class, 'Html' => Collective\Html\HtmlFacade::class, ],
That’s it! You can now include Form and HTML package in your controllers. You can test with artisan tinker:
$ php artisan tinker >>> Form::text('name') => Illuminate\Support\HtmlString {#639}
Thanks, that’s work for me.
thanks, this is very helpful
When trying Form::text(‘name’)
Im getting: Illuminate\Support\HtmlString {#635}
Pretty much lost why … any help?
Hi Jeff,
it’s normal, if you test it in a view, you should see a text input. If you’re using Laravel 5.2, it’s now returns Illuminate\Support\HtmlString instead of a string.
Good luck :)