4

Line Breaks For Textarea Text in Laravel Blade

 1 year ago
source link: https://www.laravelcode.com/post/line-breaks-for-textarea-text-in-laravel-blade
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Line Breaks For Textarea Text in Laravel Blade

  14344 views

  2 years ago

Laravel

Hi, in this article i will show you how to Line Breaks For Textarea Text in Laravel Blade. this is very common problem face in laravel application.

if you write some text in textarea and then save in database and when you display same text then it's look like dispay in one line, so how to resolve this issue in laravel blade?

simple use this solution.

Solutions

You can do the escaping first, using e() and then apply nl2br():

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

// OR

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

i hope you like this small solution.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK