Get image from storage folder in view - Laravel 5.4
I am trying to show the default.jpg image in my Laravel 5.4 profile.blade.php
.
- I created a link between the shared folder and the folder store by using:
php artisan storage:link
. - The file is saved:
- I am checking the source code of my web page which shows
src="/public/storage/uploads/avatar/default.jpg"
But still no image was found. Can someone explain to me what I am missing?
+3
source to share
5 answers
You can get the file directly from the repository folder to create a symbolic link between the folder in the repository directory and the public folder.
ln -s path/to/public/storage/uploads/avatar/ /path/to/laravel/public/avatar
Then you should be able to get it right in the blade:
<img src="{{ asset('/avatar/default.jpg') }}">
0
source to share