svg – How to insert an image using the Laravel 5.1 Blade

Question:

If I need to insert a css file or a script, I should do it respectively:

<link href="{!! asset('css/style.css') !!}" type="text/css" />
<script type="text/javascript" src="{!! asset('js/app.js') !!}"></script>

On some sites, I saw something like this (when it was a dependency related to a specific library):

{{ HTML::image('img/picture.jpg') }}

Is there any way I can insert images into my HTML page directly into the blade file scope without having to resort to external libraries?

My intention is actually to insert SVG files and I know that if I can insert any .jpeg it should also be possible to insert a .svg .

Answer:

The HTML component has been removed since Laravel 5 from the framework core.

You need to include Laravel Collective if you want to use {{ HTML::image('img/picture.jpg') }} or else directly use HTML:

<img src="{{ public_path('img/picture.jpg') }}">
Scroll to Top
AllEscort