Reputation: 4558
I have two routes mapped to the same html, generated with php blade template engine in laravel.
<img src="/images/logotype.svg" alt="">
The routes are
mydomain.com
mydomain.com/subscribers/1/edit
The first route works fine, finding the image at mydomain.com/images/logotype.svg
But the second route gives a broken image with image url like: mydomain.com/subscribers/1/edit/images/logotype.svg
From what I have read I have the right syntax for root relative paths in the html. What other error sources can I look for?
<link rel="stylesheet" href="/css/app.css">
Upvotes: 1
Views: 3004
Reputation: 1369
You should use asset()
helper for generating full url of assets:
<img src="{{ asset('/images/logotype.svg') }}" alt="">
This will find the image from public/images/logotype.svg
folder.
Upvotes: 1
Reputation: 191
If you want to add svg
<object type="image/svg+xml" data="/images/logotype.svg"></object>
Upvotes: 0