I made a component and I want it to be in different colors.
If I don't pass a color I want default to be blue.
I managed to do that with the following:
<div class="text-{{$color ?? 'blue'}}-400"></div>
But now I have a problem when I am checking 2 cases:
<div class="{{ isset($bg) ? "text-{$color ?? 'blue'}-100" : "text-{$color ?? 'blue'}-600" }}"></div>
If background image is set - show text in passed color in shade 100. If there's no bg image set text in shade 600. (If no color is passed use default 'blue' shade)
I am getting this error:
syntax error, unexpected '??' (T_COALESCE), expecting :: (T_PAAMAYIM_NEKUDOTAYIM)