Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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' => [
    CollectiveHtmlHtmlServiceProvider::class,
    ]
    
  4. and

    'aliases' => [
    
            'Form' => CollectiveHtmlFormFacade::class,
            'HTML' => CollectiveHtmlHtmlFacade::class,
    ]
    

Now the error I get is

Class 'CollectiveHtmlHtmlServiceProvider' 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"

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
181 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 'CollectiveHtmlHtmlServiceProvider::class', in config/app.php (providers)

5:Add 'Form' => CollectiveHtmlFormFacade::class, and 'Html' => CollectiveHtmlHtmlFacade::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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...