Level 60
<x-test class="text-{{ $theme->colors['primary'] }}">
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Not sure if I'm doing this wrong or it's a known limitation when ussing curly syntax inside double quotes?
syntax error, unexpected identifier "primary", expecting "]"
@php
$theme = (object)[
'colors' => ['primary' => 'red']
];
@endphp
Works
<x-test @class(["text- " . $theme->colors['primary']]) />
Doesn't work with curly syntax
<x-test @class(["text-{$theme->colors['primary']}"]) />
Test component simple output the class
<div {{ $attributes }}>test</div>
Please or to participate in this conversation.