I am upgrading from 4.2 directly to 5.1 and run into problems with the Html and Form classes.
I followed the upgrade notes, and did
But my views don't work. I get either Class HTML does not exist
when using HTML::router or get Class html does not exist
when using link_to_route
I also tried Illuminate\html
instead of laravelcollective
, I did a composer dump-autoload
.
The complete errors:
ErrorException in Container.php line 736: Class html does not exist (View: C:\Dev\www\admin\resources\views\clubs\index.blade.php)
ReflectionException in Container.php line 736: Class html does not exist
What am I missing?
I tried everyone's answers and none of them worked for me for some reason. Ultimately I created a completely new laravel application, copied my code and then it started working, So though solved the actual problem remains a mystery.
Please change your blade file from this
{{ HTML::style('css/bootstrap.min.css') }}
to
{{ Html::style('css/bootstrap.min.css') }}
It's working.
Add in composer.json
"illuminate/html": "5.*"
and run composer update
Open your config/app.php
add under 'providers'
Illuminate\Html\HtmlServiceProvider::class,
add under 'aliases'
'Form' => Illuminate\Html\FormFacade::class,
'Html' => Illuminate\Html\HtmlFacade::class,
and under your blade templates, use as such
{!! HTML::style('assets/css/flatten.css') !!}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With