Reputation: 315
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!
Upvotes: 0
Views: 830
Reputation: 287
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' }}">
Upvotes: 0
Reputation: 114
Did you try ,
Storage::get("app/public/uploads/myImageIsHere.jpeg");
https://laravel.com/docs/5.8/filesystem
Upvotes: 1
Reputation: 890
use this instead
<img src="{{ URL::to("/images/abc.jpg") }}">
this will return an image namely abc.jpg inside "public/images" folder.
Upvotes: 0