Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

frezno's avatar
Level 36

Displaying text coming from DB in blade file

THe problem im curretly running into is that i have a textfile stored in the db. The textfile contains the curly braces we use in blade, eg

lorem ipsum 
{!! Html::image('images/image.jpg', 'Title', array('class'=>'media-object')) !!}
lorem ipsum

displaying the textfile from db in the blade file:

{!! $car->text !!}

but instead of the desired output:

lorem ipsum 
<img src="http://localhost:8000/images/image.jpg" class="media-object" alt="Title">
lorem ipsum

i get

lorem ipsum 
{!! Html::image('images/image.jpg', 'Title', array('class'=>'media-object')) !!}
lorem ipsum

is there any way to get this displayed correctly, or is there any placeholder for that or any other solution?

0 likes
3 replies
jekinney's avatar
Level 47

You can't output raw format and blade format. You have to use html and not blade helpers.

Kryptonit3's avatar

just store with a prefixed slash on the src.

lorem ipsum 
<img src="/images/image.jpg" title="Title" class="media-object" />
lorem ipsum

Please or to participate in this conversation.