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

taijuten's avatar

Curly brackets to echo variable in code blocks - stripped out?

Please see https://laracasts.com/discuss/channels/laravel/2d-array-print-in-laravel-blade?page=1#reply-90482

The code block should have a variable inside with curly brackets, but this appears to be stripped out.

0 likes
6 replies
phildawson's avatar

{{ $foo }} {!! $foo !!}

{ { $foo }}
{!! $foo !!}
{{ @$foo }}
{{  $foo }}
davorminchorov's avatar

@phildawson That doesn't work in code blocks.

outside of codeblocks:

{{ $test }} // this part is escaped

{!! $test !!}

// single line code block: {{ $test }}

{!! $test !!}

inside codeblocks:
{{ $test }} // this part is escaped.
{!! $test !!} 

Please or to participate in this conversation.