3
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 that there is 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 in the scope of the Blade file 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
.
Is . svg a static file? If yes, just do it with html, assuming it’s in the folder
public/assets/images
would look like this<img src="assets/images/arquivo.svg">
.– Guilherme Nascimento
@Guilhermenascimento doesn’t work so well because Laravel maintains a file access security because of the virtual hosts I’m using. therefore mine .htaccess do not let use a tag like this
– LeandroLuk
I understand, maybe I didn’t understand how you use the server, but as far as I know
asset()
generates an accessible path, yet what I meant was the same thing as your reply, using direct <img> .– Guilherme Nascimento