0
votes

I try to access an image that is in following location:

storage/app/public/uploads/myImageIsHere.jpeg

I have tried all stack overflow options, public_path, Storage::url, creating a symlink link and thousands others.

Can someone explain me how to access this image in my .blade file ??

<img src="{{ Storage::url("app/sponsors/8R4HnbOzDdUilnSaZSRj9VzmeI7oKI9JrCWe3rgY.jpeg") }}">

GET http://127.0.0.1:8000/storage/app/sponsors/8R4HnbOzDdUilnSaZSRj9VzmeI7oKI9JrCWe3rgY.jpeg 404 (Not Found)

And this returns a correct path according to my img src path.

Thanks a lot!

3
What is the version of laravel you are using ? And what is the error message that you get? - Vagabond
@Vagabond 6.3.0 - brunelli
What is the error message that you receive ? - Vagabond
@Vagabond well the console returns a 404 of image not found, no laravel error in the UI ... - brunelli
When you create symlink the storage are linked to public folder folders which are accessible by as in your case it's uploads, so its domain.com/uploads/image.jpg , no need to go to storage file path. If blade is in route just use /uploads/image.jpg, if somewhere else then use app url along - Manjunath

3 Answers

1
votes

Did you try ,

Storage::get("app/public/uploads/myImageIsHere.jpeg");

https://laravel.com/docs/5.8/filesystem

0
votes

use this instead

<img src="{{ URL::to("/images/abc.jpg") }}">

this will return an image namely abc.jpg inside "public/images" folder.

0
votes

Run php artisan storage:link to create a symlink to your public storage disk. After that you can access your image like that:

<img src="{{ 'storage/uploads/8R4HnbOzDdUilnSaZSRj9VzmeI7oKI9JrCWe3rgY.jpeg' }}">