So I have a website that dynamically retrieves data from the form and has to display them in PDF using the dompdf library. The problem occurs when there is "enter" in the textbox, the library simply does not display it. e.g.
What is in the textbox:
Hi im trying to make PDF
using dompdf library.
What is dompdf showing:
Hi im trying to make PDF using dompdf library.
I've tried:
{{$notes = nl2br($order->note)}} //It is just showing the <br /> instead of actually doing something
{{$space = '
'}} //giving the viable the value of strong enter
{{$note = str_replace("<br />", $space, $notes)}} // trying to replace <br /> with strong enter
<td class="padding-bottom note">{{$note}}</td> // It shows 
 instead of "\n"
If you only want to show newlines and not any other html do:
{!! nl2br(e($order->note)) !!}
First it escapes the note so all other html tags are escaped and it is save to display. Than it converts all new lines to <br /> tags. And because {!! does not escape your variable you keep the html variant of <br />