One thing that's not well documented is a class conditional in blade - I've done it several ways, but using :class as a conditional and having a class="" as a base in this manner seems to work. I'm using a Tall stack. Where Livewire / Alpinejs shortcuts begin and blade ends, I'm still scratching my head. My question is, is this the 'better way' using this stack? Thx.
@class([
'bg-white', //this is always applied
'border-red-500' => true,//this is applied because true
'border-green-400' => false,//this is not applied because false
])
It's much cleaner than your example too... and will evaluate to the following...