You can do the escaping first, using e() and then apply nl2br():
e()
nl2br()
{{ nl2br(e($text)) }}
e() is the function Blade uses when compiling triple brackets
You can use this
{!! nl2br(e($text)) !!}
in simple approach you can use it in blade File
{!! nl2br(e($onlineSetting->instruction)) !!}