I'm following the excellent laravel guide on Laracasts and have gotten to the point where we're outputting song titles from a mysql database in video 7.
I wanted to go ahead and add the lyrics which I've done just fine.
Now I'd just like to format it a little better, to add new lines where required.
I've attempted to use str_replace in my view in this manner;
<p>{{str_replace("\r","\n", $song->lyrics)}}</p>
But nothing appears to happen. If I use
instead of \n, I can see that the carriage return is detected in the correct places, but my output appears like this;
looking oh so pretty,<br> I've just got to find my way.<br>
Where the < br>'s are just output as normal text.
Can anyone tell me if I'm approaching this in the right way? I've tried double and triple curly braces and I think I may be forgetting something that mentioned an exclamation mark, but I can't seem to find where it was mentioned again.
Any help would be appreciated.