$var_from_controller = "<div style="color:red">Picture inside html {{ asset('img/photo1.jpg') }} </div>"
@blade
<div id="my-container">
{!! $var_from_controller !!}
</div>
It will render {{asset()}} as a string. But I need HTML AND asset() output.
How can I do this??
This is fundamental php here. You're trying to render a php variable while it's being parsed. It's to late to inject more php then.
You'll have to build your string before it's sent to php engine for rendering. (In mvc, before passing data to the view)
In blade file change below code. concatenate image path in variable