1

I'm trying to print some content formatted in HTML but it just prints the code

<td>{{ html_entity_decode($p->content) }}</td>

This code prints this: <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur quidem alias fugit hic incidunt consequuntur quasi fuga tenetur sit perferendis nisi dignissimos accusantium ab expedita temporibus velit dolorum, ipsam explicabo</p>

Any idea? Without html_entity_decode it's even worse.

Sethei
  • 105
  • 6

1 Answers1

1

You are telling blade to escape it and so it prints the actual HTML, including the <p> tags. You have stored the HTML tags within $p->content.

To fix, use the unescaped blade syntax:

<td>{!! $p->content !!}</td>
Watercayman
  • 7,970
  • 10
  • 31
  • 49