Level 27
UploadedFile::fake()->createWithContent('file.pdf', $content);
1 like
Summer Sale! All accounts are 50% off this week.
I came across this https://gist.github.com/waska14/8b3bcebfad1f86f7fcd3b82927576e38 which converts a string into a Illuminate\Http\UploadedFile. However, it writes to the disk as part of the process and deletes it before terminating.
Is there a more direct way of doing this? Thank you.
UploadedFile::fake()->createWithContent('file.pdf', $content);
Please or to participate in this conversation.