Inserting Line breaks into Mysql txt

Posted 7 months ago by longestdrive


I have a form with a text area. When a user adds notes they can add new lines as expected whilst they edit.

I want to be able to add new lines to this text in my code but whilst I can add the new text I can't create new lines.

The code to add new text is:

$notes .= date('d/m/Y h:i') . ": Booking created by " . $this->user->present()->fullName() . "<br/ >";

I have also tried \n instead of <br /> but it makes no difference

When I try and display it back in a form text area all I see is the charactersL (<br /> or \n) and no new lines

I have tried:

<textarea>{!! $reservation->notes !!}<textarea/>

    <textarea>{!! e($reservation->notes) !!}<textarea/>

   <textarea>{!! nl2br(e($reservation->notes)) !!}<textarea/>

and same combinations for {{ }}

How can I add text to existing text on a new line so it appears correctly as a new line in the textarea?

Please sign in or create an account to participate in this conversation.