amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

the-new-class-blade-directive-in-laravel-8x/ #22

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

The new @class Blade directive in Laravel 8.x – Amit Merchant – A blog on PHP, JavaScript and more

Sometimes, the biggest sign that shows that a framework is maturing is when it has multiple ways of doing the same thing. Laravel, being one of these frameworks, is no exception.

https://www.amitmerchant.com/the-new-class-blade-directive-in-laravel-8x/

proclame commented 3 years ago

Are the curly braces supposed to be there around the @class directive?

amitmerchant1990 commented 3 years ago

@proclame No. Curly braces are not supposed to be there. It was a mistake. I fixed it now. Thanks for spotting it!

burfbari commented 2 years ago

Hi, the following doesn't work:

<option>
    some option 
    @if ()
        <div @class("notice")> with notification</div>
    @endif

Isn't it the same as what you've suggested?