Replies: 1 comment
-
In the Avatars Controller you are storing the file in Instead you want to save it to the disk $path = $request->file('avatar')->store('', 'avatars');
// or
$path = $request->file('avatar')->store('', [
'disk' => 'avatars',
]); Link to Documentation: https://laravel.com/docs/8.x/requests#storing-uploaded-files |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
When attempting to test file uploads in my application, the laravel documentation tells me to call Storage::fake(). This returns a FileSystemAdapter configured for the testing environment. But doesn't appear to be application-wide.
The fake file that gets uploaded isn't get stored in the testing path, but instead gets stored to the regular storage folder.
I attempted both the described method for handling file uploads, and the referenced method using the Storage facade. Both result in the file getting stored in the wrong folder.
Steps To Reproduce:
Route::post('/avatars', [UserAvatarController::class, 'update']);
Expected result:
storage/framework/testing/disks/avatars
Actual result:
storage/app/avatars
Repository demonstrating the issue:
https://github.com/tkuijer/laravel-storagefake-bugreport
Beta Was this translation helpful? Give feedback.
All reactions