Closed skakrecha closed 2 years ago
Here is a simple approach:
// save incoming attachments
collect($inboundEmail->attachments())->each(function (MessagePart $attachment) use ($model) {
$model->addMediaFromString($attachment->getContent())
->usingFileName($attachment->getFilename() ?? 'unnamed')
->toMediaCollection('files');
});
Hi , i am using the package to store incoming mails in db, but want to use spatie medialibrary to store the attachments.
Thanks.