I want to keep the linebreaks in my view from data I'm receiving from my database. The data was saved from a textarea into the database. Now I want to keep the line breaks when using this value in blade. I'm using Laravel + Blade. I tried this but its not working:
{{ nl2br(e($textValue)) }}
In Laravel 5 and later your can use:
{!! nl2br(e($text)) !!}
For Laravel 4 try it this way:
{{ nl2br(e($text)) }}
e() will run htmlentities() on the given string and returns it as HTML entities.