If you are using the Blade templating engine in Laravel, you may want to know how to render an HTML string. Here is how you can do it:
First, create a Blade view file and name it something like myview.blade.php.
Next, add the following code to the view:
{{ $htmlString }}
Finally, in your controller, send the HTML string to the view:
return view('myview')->with('htmlString', $htmlString);
Step 1: Create a fresh Laravel project
composer create-project --prefer-dist laravel/laravel blog
Step 2: Add routes in routes/web.php
Create routes to call our controller and the blade file in it.
routes/web.php
Step 3: Create View File
Now, create a example-view.blade.php
in resource/views
folder.
{{ $htmlString }}
<p class="text-muted"> {!! $data->description !!} </p>
This will render the string as an HTML link.