After uploading a document successfully like this:
$documentUploaded = $company->addMedia($file)->toMediaCollection();
When I try to fetch the document using storage:
Storage::get($documentUploaded->getPath());
I get the following error:
League\Flysystem\FileNotFoundException(code: 0): File not found at path: C:/wamp/www/my-app/storage/app/public/69/THIS-WILL-BE-ENCRYPTED.docx at C:\wamp\www\my-app\vendor\league\flysystem\src\Filesystem.php:388) [stacktrace]
When I try to dump the file path:
dd($documentUploaded->getPath());
I get this:
C:\wamp\www\my-app\storage\app\public/69/THIS-WILL-BE-ENCRYPTED.docx
When I check in both storage
and public
directories I can see the file there.
I already created a symlink between the public and storage directories with php artisan storage:link
so I don't know what's going on here?