I am trying to use {{ HTML }}
in my project however I am running into several errors. I researched on internet about the problem, and I believe I am doing the right steps, however, I keep falling in the same error while I am trying to load my master page.
FatalErrorException in ... line 9: Class 'HTML' not found
So what I did was:
Edited the
composer.json
file and added"illuminate/html": "5.*"
underrequire {}
Run
composer update
(everything seems fine)Added:
providers => 'Illuminate\Html\HtmlServiceProvider',
as well as`aliasses => 'Form' => 'Illuminate\Html\FormFacade', 'Html' => 'Illuminate\Html\HtmlFacade',
(Even though the ones already placed under aliasses and providers are as follows which seems the ones I added looks quite different than the rest:
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
'Illuminate\Html\HtmlServiceProvider', // The one I added
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
'Form' => 'Illuminate\Html\FormFacade', // I added
'Html' => 'Illuminate\Html\HtmlFacade', // I added
And here is the snippet version of my master.blade.php
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset = "UTF-8">
<title></title>
{{ HTML::script('js/jquery.js') }} // Line 9
{{ HTML::script('js/bootstrap.js') }} // Line 10
{{ HTML::style('css/bootstrap.js') }} // Line 11
</head>
The error I am getting is:
FatalErrorException in ### line 9: Class 'HTML' not found in
/Applications/MAMP/htdocs/laratest/storage/framework/views/### line 9
I was benefiting from several tutorials such as This one on YouTube and Laracast. I also found a Solved-tagged question which is addressing the same issue but did not fix the issue in my case.
Edit: Also changing to {!! HTML !!}
is not working either