0

I'm having trouble with importing a css style sheet located in public/css in a blade file located in resources/views/includes.

The code I used in the blade file is

{{ HTML::style('css/layout.css') }}

which didn't work. I also tried

{{ HTML::style('css/layout.css', array('media' => 'print')) }}

The error I get is Class 'HTML' not found

I followed the steps in this question, so

  1. I added "laravelcollective/html": "5.4.16" in composer.json
  2. run composer update
  3. added in config/app.php

    'providers' => [
    Collective\Html\HtmlServiceProvider::class,
    ]
    
  4. and

    'aliases' => [
    
            'Form' => Collective\Html\FormFacade::class,
            'HTML' => Collective\Html\HtmlFacade::class,
    ]
    

Now the error I get is

Class 'Collective\Html\HtmlServiceProvider' not found

And I don't understand why, as I added it to app.php. Indeed, when I go to app.php and the line where I added Collective.., the "Html" is colored in red and when I hover over it it says

Undefined namespace Html

What should I do about it? All this laravel thing is getting confusing to me.

Apart from the fact that I don't know what to do with,

{{HTML::linkAction('MemberController@show', 'view', array($value->id))}}

i found nothing online regarding the arguments of "linkAction"

Community
  • 1
  • 1
Ileana Profeanu
  • 377
  • 2
  • 10
  • 33

1 Answers1

3

1:Remove "laravelcollective/html": "5.4.16" in composer.json and clean other config for this package in config/app.php.

2:Run composer update

3:Run composer require laravelcollective/html

4:Add 'Collective\Html\HtmlServiceProvider::class', in config/app.php (providers)

5:Add 'Form' => Collective\Html\FormFacade::class, and 'Html' => Collective\Html\HtmlFacade::class, in config/app.php (aliases)

6:In controller try use Html; and use Form;

If you get any other error please share composer.json and config/app.php.