Lindie2669's avatar

How to show a image from the storage folder

I am making a website where i upload a image and later show the image in the website. The uploaded image ends up in the storage folder (path: storage\images\uploads)

This is what i did:

  1. created a symlink to make a connection. php artisan storage:link

  2. And load the uploaded image in the view: <img src="{{ asset('storage/images/uploads/'.$product -> afbeelding) }}" alt="" title=""/>

But it doesn't work.

Am I doing something wrong? Did I forget a step?

0 likes
3 replies
siangboon's avatar

double check the storage exist in the public folder, open your Internet browser and try access the full URL of the image (try with and without "storage") ...

Lindie2669's avatar

The storage folder in the public folder exist. In the storage folder is a .gitignore file.

Snapey's avatar
Snapey
Best Answer
Level 122

So for the image to appear in the storage/images/uploads folder, you should actually save the image to storage/app/public/images/uploads

So you put it in your storage/app/public folder and it appears by symlink in public/storage

I know the naming is confusing. Just an unfortunate choice by taylor in the early days.

Please or to participate in this conversation.