I'm trying to retrieve a file from this path in a laravel project:
/storage/app/public/blog/3.jpg
These approaches produce following errors:
1.
$image = Storage::disk('public')->get('/storage/blog/3.jpg');
->
local.ERROR: File not found at path: storage/blog/3.jpg {"userId":16,"exception":"[object] (Illuminate\\Contracts\\Filesystem\\FileNotFoundException(code: 0): File not found at path: storage/blog/3.jpg at /Users/artur/PhpstormProjects/safa-ameedee.com/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:171)
[stacktrace]
$image = Storage::disk('public')->get('/storage/app/public/blog/3.jpg');
$image = Storage::get('/storage/app/public/blog/3.jpg');
->
local.ERROR: File not found at path: storage/app/public/blog/3.jpg {"userId":16,"exception":"[object]
The weird thing is that I store the files in the storage like so:
Storage::disk('public')->put('/blog/' . $request->path, $image);
So should they not be retrievable in the same way?
/storage.Storage::disk('public')->get('/blog/3.jpg');would be "the same way"