save new line on database and parse in laravel blade Articles

save new line on database and parse in laravel blade

by | Jun 13, 2019 | Laravel | 0 comments

I was trying to save post with newlines. I see the post is being saved and newlines are shown in post edit page. But when i show the post it removes all the spaces and shows all text together.

it is a simple trick. When we show the data on blade/view we have to call the variable in a different manner.

{!! nl2br(e($share->detail)) !!}

It will output the text with newline.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Name Goes Here

Name Goes Here

Position

Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.