How can display space in view blade laravel 5.3?

2019-09-19 07:45发布

问题:

My records in db is like this :

I want to display with space

I try like this :

{{ nl2br($text) }}

and

{{ nl2br(e($text)) }}

It does not work

How can I solve it?

回答1:

have you tried using {!! !!} here you can use HTML entity &nbsp



回答2:

you can create a helper like this $output = nl2br(str_replace(" ", "  ", $db_record));

Then your blade file {!! $output !!};