Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get Image from the Storage Folder in View - Laravel 5.4

I'm trying to show the default.jpg avatar picture in my Laravel 5.4 profile.blade.php.

  • I created a link between the public folder and the storage folder with: php artisan storage:link.
  • The file is stored:

enter image description here

  • I check in the source code of my webpage which showed the src="/public/storage/uploads/avatar/default.jpg"

But still no image could be found. Could someone explain to me what I am missing?

like image 456
Anna Jeanine Avatar asked Dec 03 '22 21:12

Anna Jeanine


2 Answers

You can use this in the view once the storage link is present:

<img src="{{ asset('storage/uploads/avatar/default.jpg') }}" alt="" />

That will generate the full asset url to your image.

like image 24
Robert Avatar answered Dec 08 '22 14:12

Robert


remove public from path and image will be shown if you set correct link

like image 194
omadonex Avatar answered Dec 08 '22 14:12

omadonex