Arminius
Arminius

Reputation: 606

Laravel: class HTML not found despite having installed everything needed (cloud 9 ) 2 UPDATES

I am familiar with Laravel. Have done it countless times but never on cloud 9. However installation as per procedure perfectly fine the Laravel installation.

In order to install the HTML class I went:

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

and composer update

Then in the app.php file Providers array

Illuminate\View\ViewServiceProvider::class,
Illuminate\Html\HtmlServiceProvider::class,

Now same file, Façade:

'Html'      => Illuminate\Html\HtmlFacade::class,
'Form'      => Illuminate\Html\FormFacade::class,

yet, when I wrote the

{{ !! HTML:: style('css/styles.css') !! }}

it still goes Class 'HTML' not found

I restarted the server too.

I even tried to call the use html from the controller so directly from the namespace. No effect.

So, definitively there must be something that is preventing the class to work for whatever the reason.

I am flummoxed

is there anything I am missing in the c9.io coding for environment?

UPDATE

These packages have become updated a short time ago if you have the version 5.2

So now it is necessary to remove that

illuminate/html": "5.*",

and replace it by a collective series of packages according to instructions here:

https://laravelcollective.com/docs/5.2/html

It must be noted that there can be also an error thrown:

regarding the method bindShared() which is part of the package Illuminate/html.

That file needs to be edited too.

On lines 36 and 49, you need to replace the bindShared by singleTon

but despite having done all that, the html class problem is still there

So, I am thinking that the issue is not fixed just by deleting the illuminate from composer json and doing an update. The protocol is more complicated.

A possible solution (by https://laracasts.com/@philsown) could be this one:

Use the laravelcollective/html package instead of illuminate/html going forward.

How to change over cleanly:

First, comment out the references to Illuminate\Html in your config/app.php. (Don't remove them, you're going to change them in a minute.)

Next, do composer remove illuminate/html.

After that, do

composer require laravelcollective/html.

Now uncomment the

Illuminate\Html 

items in your config/app.php file and update references to

Collective\Html 

instead of

Illuminate\Html.

If it works, you might get an error "Undefined variable: errors (view ... path to view). In which case, update your routes.php file to use the new 'web' middleware.

Route::group(['middleware' => ['web']], function () use ($router) { $router->resource('whatever', 'WhateverController'); });

Updated 3

There is a related collateral issue mentioned here

Laravel Upgrading To 5.2.0 From 5.1 error

Upvotes: 1

Views: 638

Answers (1)

user2094178
user2094178

Reputation: 9454

When changing to laravelcollective/html it is supposed to be Html:: instead of HTML::.

I had exactly the same issue as yours.

Upvotes: 2

Related Questions