asset() behaving strangely

Posted 1 year ago by mdecooman

On my machine the view renders the image with either of these

//the image is in /storage/app/public/

<img class="card-img-top" src="{{ asset('storage/'. $image) }}">

and

<img class="card-img-top" src="{{ asset($image) }}">

But when deployed only the first one works (as I would expect). So, my question is why on my local machine, the image is rendered?

config: Laravel 5.5 and my configuration file is basic, I only changed the APP_URL in the environment file accordingly. The php artisan storage:link was run and the symlinks are working as expected too.

Not a show stopper but when something 'magic' happens on your local machine you get curious...

Anyone ran into the same weird behaviour?

:)

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.