Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Call to undefined method Illuminate\Html\HtmlServiceProvider::style()`

I'm using the laravel 5.1 framework on my centos6 host. I already used composer install illuminate/html, but calling HTML::style() results in this error: FatalErrorException in 7b06fa36a7460c71e5daf57645a3dbda line 12: Call to undefined method Illuminate\Html\HtmlServiceProvider::style()

My app config :

'aliases' => [
    //more...
    'HTML' => Illuminate\Html\HtmlServiceProvider::class,
    'Form' => Illuminate\Html\FormFacade::class
],

'providers' => [
    //more...
    Illuminate\View\ViewServiceProvider::class,
    Illuminate\Html\HtmlServiceProvider::class,
]

composer.json:

  "require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.1.*",
    "illuminate/html": "5.*"
},

Such as {!! Form::open() !!} ... is well except HTML::style().

What should I do?

like image 244
cow Avatar asked Dec 25 '22 15:12

cow


1 Answers

You have aliased invalid class.

Replace

'HTML' => Illuminate\Html\HtmlServiceProvider::class,

with

'HTML' => Illuminate\Html\HtmlFacade::class,
like image 53
jedrzej.kurylo Avatar answered Dec 27 '22 21:12

jedrzej.kurylo