Rendering HTML from database table to view in Laravel

You can render HTML from database table to view blade in Laravel using html_entity_decode() and {!! $data !!} blade directive.

Answers 1
  • Laravel display HTML content in blade as unescaped Data

    --PATH resources\views\<home>.blade.php
    {!! $data->body !!}
    @php echo html_entity_decode($data->body) @endphp

    You can use {!!  and  !!} and @php echo html_entity_decode($data->body) @endphp to display HTML content as HTML in laravel view file.   

  • Back to code snippet queries related laravel