Class form or html not found in Laravel 5
Class form or html not found in Laravel 5 :-
Recently i am working with new laravel 5 and found there is more changes or you can say it’s whole rebuild new version. also if you are working with form or html classes you will get Class form or html not found in Laravel 5.
Why error Class Form or HTML not found in Laravel 5 ?
Because of default in Laravel 5 Html and Form are not embedded anymore. Now form builder is a separate package. you need to Pull in “illuminate/html” to get it back.
For this i am sharing below steps how we can pull it back or how we can resolve error Class Form or HTML not found in Laravel 5.
1.Open your “root/composer.json” and add below line in “require” section :
"illuminate/html": "5.*"
Example:- so now your file code of require section looks like:-
"require": { "illuminate/html": "5.*", "laravel/framework": "5.0.*" },
2.Now you need to run “composer update” coomand. for this pick up your laravel application directory path in CLI or terminal and run
composer update
Now after successfully install “Illuminate\Html” you need to add this Laravel Framework Service Providers list. for this go to “config/app.php” and add below code to “providers” array to further use:
'Illuminate\Html\HtmlServiceProvider',
Example:- so now your file code of provider array section looks like:-
'providers' => [
/* more already here */
'Illuminate\Html\HtmlServiceProvider',
3.Now go to “config/app.php” and below code to “aliases” array:
'Html' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
Example:- so now your file code of aliases array section looks like:-
'aliases' => [
/* more already here */
'Html' => 'Illuminate\Html\HtmlFacade',
'Form' => 'Illuminate\Html\FormFacade',
],
Now try in your example.blade.php with new syntax {!! $var !!} old style {{$var}} and {{{$var}}} has been deprecated and removed. so use like below example.
Why deprecated ?:- In laravel 4 it included the following two styles: “{{” and “{{{“. The double curly bracket was a raw echo and the triple curly bracket escaped. Currently in laravel 5 both the double and triple curly brackets escape the variable and a new “{!! $var !!}” is for raw.
{!! Form::open() !!}
{!! Form::text('name', @$name) !!}
{!! Form::submit('Send') !!}
{!! Form::close() !!}
Now run your file and you have solved error Class Form or HTML not found in Laravel 5.
from :http://www.tuicool.com/articles/vmEvYrz