LoginSignup
0
0

More than 1 year has passed since last update.

【laravel】改行コードを含む文字列をDBから取得しbladeで表示させる方法

Posted at

環境

  • laravel 6.17.1
  • PostgreSQL

内容

DB上に登録されているテキストデータに<br>が含まれている。
Bladeで表示する際に改行された状態で表示させたい。

結論

表示させたい箇所で以下のように記載する
{!! nl2br($変数名) !!}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0