How do I use nl2br() in Laravel 5 Blade

前端 未结 4 1708
心在旅途
心在旅途 2021-02-02 08:57

So I want to keep linebreaks from the database while using the Blade Template Engine. I came up on the idea using

{!! nl2br(e($task->text)) !!}
4条回答
  •  余生分开走
    2021-02-02 09:24

    Below solution worked in blade file in Laravel 5.7 version for me:

    {!! nl2br(e($contactusenquiry_message), false) !!}
    

    Thanks to ask this question.

提交回复
热议问题