Attachment
class Attachment (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
string|null | $as | The attached file's filename. |
|
string|null | $mime | The attached file's mime type. |
|
protected Closure | $resolver | A callback that attaches the attachment to the mail message. |
Methods
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Create a mail attachment from a path.
Create a mail attachment from a URL.
Create a mail attachment from a file in the default storage disk.
Create a mail attachment from a file in the specified storage disk.
Set the attached file's filename.
Set the attached file's mime type.
Attach the attachment with the given strategies.
Attach the attachment to a built-in mail type.
Determine if the given attachment is equivalent to this attachment.
Details
static Attachment
fromData(Closure $data, string|null $name = null)
Create a mail attachment from in-memory data.
static Attachment
fromStorage(string $path)
Create a mail attachment from a file in the default storage disk.
static Attachment
fromStorageDisk(string|null $disk, string $path)
Create a mail attachment from a file in the specified storage disk.
mixed
attachWith(Closure $pathStrategy, Closure $dataStrategy)
Attach the attachment with the given strategies.
mixed
attachTo(Mailable|Message|MailMessage $mail, array $options = [])
Attach the attachment to a built-in mail type.
bool
isEquivalent(Attachment $attachment, array $options = [])
Determine if the given attachment is equivalent to this attachment.