How to Display Saved Images in Laravel 5.5?

500 Views Asked by At

I am trying to show stored images in img element. I have saved an image by using a Laravel built-in function.

$path = $request->file('image')->store('avatars');

According to the above script, the images are saving to:

Storage > app > avatars

I also tried saving them here:

Storage > app > public > avatars

Afterward, I used the Artisan command: php artisan storage:link

And then in the front end:

<img src="{{ url('storage/'.$Product->image) }}" width="30" height="30"/>
<img src="{{ asset('storage/'.$Product->image) }}" width="30" height="30"/>
<img src="{{ asset($Product->image) }}" width="30" height="30"/>
<img src="{{ asset('public/storage/'.$Product->image) }}" width="30" height="30"/>

However, the image is still not displayed. Can someone kindly let me know where I'm wrong so that I can fix it? I would appreciate that.

0

There are 0 best solutions below