Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yswery's avatar

How to render a curly brace in blade

Hi Team

So I need to render the following in plain text:

{MyContent}

MyContent being stored in a variable in blade.

If I try in blade {{{$var}}} it ofcourse renders as MyContent and if I try to escape with the @ like @{{{$var}}} I get {{{$var}}} as my output.

I know if I put in a space between the curly brace like @{ {{$var}} } it will render as { MyConetent } however I do not want these spaces in the final rendered output.

Is there any way to escape the curly brace in blade?

0 likes
4 replies
yswery's avatar

I forgot to mention, I cant manually use @php echo $var @endphp since the $var is an iteration from a blade loop (meaning its not accessible by @php)

Sabonzy's avatar

you can try something like this {!! '{'.$var.'}' !!}

1 like
MichalOravec's avatar
Level 75

This will work:

{{ '{' . $var . '}' }}
1 like
yswery's avatar

@MichalOravec Wow ok, I am little bit embarrassed overthinking everything and not simply doing this. Thanks, that solves everything!

Please or to participate in this conversation.