class
Illuminate
/
Mail
/
Attachment
Attachment
Uses
Properties
public
$as string|null
The attached file's filename.
Default: null
public
$mime string|null
The attached file's mime type.
Default: null
protected
$resolver Closure
A callback that attaches the attachment to the mail message.
Default: null
Methods
private
__construct ( Closure $resolver ) : void
Create a mail attachment.
Parameters
- $resolver Closure
public
static
fromPath ( $path ) : static
Create a mail attachment from a path.
Parameters
- $path string
public
static
fromData ( Closure $data , $name ) : static
Create a mail attachment from in-memory data.
Parameters
- $data Closure
- $name string|null
public
static
fromStorage ( $path ) : static
Create a mail attachment from a file in the default storage disk.
Parameters
- $path string
public
static
fromStorageDisk ( $disk , $path ) : static
Create a mail attachment from a file in the specified storage disk.
Parameters
- $disk string|null
- $path string
public
as ( $name ) : $this
Set the attached file's filename.
Parameters
- $name string|null
public
withMime ( $mime ) : $this
Set the attached file's mime type.
Parameters
- $mime string
public
attachWith ( Closure $pathStrategy , Closure $dataStrategy ) : mixed
Attach the attachment with the given strategies.
Parameters
public
attachTo ( $mail , $options ) : mixed
Attach the attachment to a built-in mail type.
Parameters
- $mail Mailable |Message |MailMessage
- $options array
public
isEquivalent ( Attachment $attachment , $options ) : bool
Determine if the given attachment is equivalent to this attachment.
Parameters
- $attachment Attachment
- $options array