Level 39
In this cde : Storage::disk('services')
services must be a disk not a directory
This piece of code works
Storage::fake('services');
$file = File::image('test.jpg');
$response = $this->json('POST', '/services', [
'image' => $file
]);
Storage::disk('public')->assertExists('/services/'.$file->hashName());
Storage::disk('public')->delete('/services/'.$file->hashName());
but this does not works
Storage::fake('services');
$file = File::image('test.jpg');
$response = $this->json('POST', '/services', [
'image' => $file,
]);
Storage::disk('services')->assertExists($file->hashName());
Storage::disk('services')->delete($file->hashName());
although the last one is prefered way in the documentation. The folders are created inside the framework/testing/disk but the files are inserted in the public.
Controller Code to store image
$request->file('image')->store('services','public')
In this cde : Storage::disk('services')
services must be a disk not a directory
Please or to participate in this conversation.