Blade: escaping text and allowing new lines
You can do the escaping first, using e()
and then apply nl2br()
:
{{ nl2br(e($text)) }}
e()
is the function Blade uses when compiling triple brackets
You can use this
{!! nl2br(e($text)) !!}
You can do the escaping first, using e()
and then apply nl2br()
:
{{ nl2br(e($text)) }}
e()
is the function Blade uses when compiling triple brackets
You can use this
{!! nl2br(e($text)) !!}