Crazylife's avatar

How to delete s3 image in feature test?

In my feature test was using Storage::fake('s3'), but when calling my api to delete the image then it will throw error as my API using Storage::disk('s3')->delete($path).

Any idea how i can achieve this?

0 likes
3 replies
Crazylife's avatar

but then it seems not detected when i am doing destroy image test, where the image not found with s3 url path provided. I have to use disk('s3') instead of fake('s3')

martinbean's avatar

Yes. Once you’ve swapped a disk with a fake, you then use that disk like you would normally.

If you’re still having issues, then show your test. We can’t help you without seeing any code.

Please or to participate in this conversation.