Reputation: 2748
I am uploading an image to local storage as
$path = $request->image->store('images');
Image gets stored in storage/app/images/name.extension
However my problem is showing this image to the user, I am getting file not found exception
I tried, asset, Storage:get, Storage::url and etc.
Any solutions?
Upvotes: 0
Views: 1546
Reputation: 2748
Mistake was I was storing files in storage/app/images directory instead of storage/app/public/images and finally I retrieved using
asset('storage/'.$image-name)
Upvotes: 0
Reputation: 1999
You can create a symbolic link to the storage/app/images/
from the public
directory.
ln -s storage/images public/images
Upvotes: 1
Reputation: 611
Try this one
Storage::get('/images/'.$filename);
or
Storage::get('/app/images/'.$filename);
Upvotes: 0