The first parameter of ->store() is the path. It makes a random name automatically. Use ->storeAs('path', 'test.mp3') if you want to specify the filename
Nov 1, 2022
3
Level 13
UploadedFile::fake() creates folder rather than file
How to work UploadedFile::fake() in none-http context ?
I want to create a fake mp3 file but laravel create a folder:
Storage::fake('public');
UploadedFile::fake()->create('test.mp3', 100)->store('test.mp3', ['disk' => 'public']);
Storage::disk('public')->assertExists('test.mp3');
It create test.mp3 as folder but i excepted this to be a file...
Another issue, The file inside the folder has 0 byte of size, But i excepted 100, What is wrong ?
How can i store test.mp3 under public dir ?
Level 102
1 like
Please or to participate in this conversation.