class Mailable implements Mailable, Renderable

Traits

Properties

static protected array $macros

The registered string macros.

from  Macroable
string|null $locale

The locale of the message.

array $from

The person the message is from.

array $to

The "to" recipients of the message.

array $cc

The "cc" recipients of the message.

array $bcc

The "bcc" recipients of the message.

array $replyTo

The "reply to" recipients of the message.

string $subject

The subject of the message.

string|null $markdown

The Markdown template for the message (if applicable).

protected string|null $html

The HTML to use for the message.

string|null $view

The view to use for the message.

string|null $textView

The plain text view to use for the message.

array $viewData

The view data for the message.

array $attachments

The attachments for the message.

array $rawAttachments

The raw attachments for the message.

array $diskAttachments

The attachments from a storage disk.

protected array $tags

The tags for the message.

protected array<string, null|int|string> $metadata

The metadata for the message.

array $callbacks

The callbacks for the message.

string|null $theme

The name of the theme that should be used when formatting the message.

string|null $mailer

The name of the mailer that should send the message.

protected array $assertionableRenderStrings

The rendered mailable views for testing / assertions.

static ?callable $viewDataCallback

The callback that should be invoked while building the view data.

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

mixed
withLocale(string|null $locale, Closure $callback)

Run the callback with the given locale.

mixed
getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

mixed
extractAttributeValue(object $instance)

Extract the value from an attribute instance.

object|null
getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

bool
propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

mixed
tap(callable|null $callback = null)

Call the given Closure with this instance then return the instance.

from  Tappable
static void
macro(string $name, callable|object $macro)

Register a custom macro.

static void
mixin(object $mixin, bool $replace = true)

Mix another object into the class.

static bool
hasMacro(string $name)

Check if macro is registered.

static void
flushMacros()

Flush the existing macros.

static mixed
__callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

mixed
__call(string $method, array $parameters)

Dynamically bind parameters to the message.

send(Factory|Mailer $mailer)

Send the message using the given mailer.

mixed
queue(Factory $queue)

Queue the message for sending.

mixed
later(DateInterval|DateTimeInterface|int $delay, Factory $queue)

Deliver the queued message after (n) seconds.

mixed
newQueuedJob()

Make the queued mailable job instance.

string
render()

Render the mailable into a view.

array|string
buildView()

Build the view for the message.

array
buildMarkdownView()

Build the Markdown view for the message.

array
buildViewData()

Build the view data for the message.

array
additionalMessageData()

Get additional meta-data to pass along with the view data.

buildMarkdownHtml(array $viewData)

Build the HTML view for a Markdown message.

buildMarkdownText(array $viewData)

Build the text view for a Markdown message.

string
markdownTheme()

Resolve the Markdown theme for this message.

buildFrom(Message $message)

Add the sender to the message.

buildRecipients(Message $message)

Add all of the recipients to the message.

buildSubject(Message $message)

Set the subject for the message.

buildAttachments(Message $message)

Add all of the attachments to the message.

void
buildDiskAttachments(Message $message)

Add all of the disk attachments to the message.

buildTags(Message $message)

Add all defined tags to the message.

buildMetadata(Message $message)

Add all defined metadata to the message.

runCallbacks(Message $message)

Run the callbacks for the message.

locale(string|null $locale)

Set the locale of the message.

priority(int $level = 3)

Set the priority of this message.

from(array|object|string $address, string|null $name = null)

Set the sender of the message.

bool
hasFrom(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

to(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasTo(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

cc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasCc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

bcc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

bool
hasBcc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

replyTo(array|object|string $address, string|null $name = null)

Set the "reply to" address of the message.

bool
hasReplyTo(array|object|string $address, string|null $name = null)

Determine if the given replyTo is set on the mailable.

setAddress(array|object|string $address, string|null $name = null, string $property = 'to')

Set the recipients of the message.

array
addressesToArray(array|object|string $address, string|null $name)

Convert the given recipient arguments to an array.

object
normalizeRecipient(mixed $recipient)

Convert the given recipient into an object.

bool
hasRecipient(array|object|string $address, string|null $name = null, string $property = 'to')

Determine if the given recipient is set on the mailable.

subject(string $subject)

Set the subject of the message.

bool
hasSubject(string $subject)

Determine if the mailable has the given subject.

markdown(string $view, array $data = [])

Set the Markdown template for the message.

view(string $view, array $data = [])

Set the view and view data for the message.

html(string $html)

Set the rendered HTML content for the message.

text(string $textView, array $data = [])

Set the plain text view for the message.

with(array|string $key, mixed $value = null)

Set the view data for the message.

attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

attachMany(array $files)

Attach multiple files to the message.

bool
hasAttachment(Attachable|Attachment|string $file, array $options = [])

Determine if the mailable has the given attachment.

attachFromStorage(string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

attachFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

bool
hasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from storage.

bool
hasAttachmentFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from a specific storage disk.

attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

bool
hasAttachedData(string $data, string|null $name, array $options = [])

Determine if the mailable has the given data as an attachment.

tag(string $value)

Add a tag header to the message when supported by the underlying transport.

bool
hasTag(string $value)

Determine if the mailable has the given tag.

metadata(array|string $key, int|string|null $value = null)

Add a metadata header to the message when supported by the underlying transport.

bool
hasMetadata(string $key, int|string $value)

Determine if the mailable has the given metadata.

assertFrom(array|object|string $address, string|null $name = null)

Assert that the mailable is from the given address.

assertTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasCc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasBcc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

assertHasReplyTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given "reply to" address.

assertHasSubject(string $subject)

Assert that the mailable has the given subject.

assertSeeInHtml(string $string, bool $escape = true)

Assert that the given text is present in the HTML email body.

assertDontSeeInHtml(string $string, bool $escape = true)

Assert that the given text is not present in the HTML email body.

assertSeeInOrderInHtml(array $strings, bool $escape = true)

Assert that the given text strings are present in order in the HTML email body.

assertSeeInText(string $string)

Assert that the given text is present in the plain-text email body.

assertDontSeeInText(string $string)

Assert that the given text is not present in the plain-text email body.

assertSeeInOrderInText(array $strings)

Assert that the given text strings are present in order in the plain-text email body.

assertHasNoAttachments()

Assert the mailable has no attachments.

assertHasAttachment(Attachable|Attachment|string $file, array $options = [])

Assert the mailable has the given attachment.

assertHasAttachedData(string $data, string $name, array $options = [])

Assert the mailable has the given data as an attachment.

assertHasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from storage.

assertHasAttachmentFromStorageDisk(string $disk, string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from a specific storage disk.

assertHasTag(string $tag)

Assert that the mailable has the given tag.

assertHasMetadata(string $key, int|string $value)

Assert that the mailable has the given metadata.

array
renderForAssertions()

Render the HTML and plain-text version of the mailable into views for assertions.

void
prepareMailableForDelivery()

Prepare the mailable instance for delivery.

bool
usesMailer(string $mailer)

Determine if the mailable will be sent by the given mailer.

mailer(string|null $mailer)

Set the name of the mailer that should send the message.

withSymfonyMessage(callable $callback)

Register a callback to be called with the Symfony message instance.

static void
buildViewDataUsing(callable $callback)

Register a callback to be called while building the view data.

static void
flushState()

Flush all static state.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in ForwardsCalls at line 22
protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 52
protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 66
static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

in Localizable at line 21
mixed withLocale(string|null $locale, Closure $callback)

Run the callback with the given locale.

Parameters

string|null $locale
Closure $callback

Return Value

mixed

protected mixed getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

Parameters

object $target
string $attributeClass
string|null $property
mixed $default

Return Value

mixed

protected mixed extractAttributeValue(object $instance)

Extract the value from an attribute instance.

Parameters

object $instance

Return Value

mixed

protected object|null getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

Parameters

object $target
string $attributeClass
ReflectionClass|null $declaringClass

Return Value

object|null

protected bool propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

Parameters

object $target
ReflectionClass $reflection
string|null $property
ReflectionClass $attributeDeclaringClass

Return Value

bool

in Tappable at line 17
mixed tap(callable|null $callback = null)

Call the given Closure with this instance then return the instance.

Parameters

callable|null $callback

Return Value

mixed

in Macroable at line 30
static void macro(string $name, callable|object $macro)

Register a custom macro.

Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.

Parameters

string $name
callable|object $macro

Return Value

void

in Macroable at line 44
static void mixin(object $mixin, bool $replace = true)

Mix another object into the class.

Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.

Parameters

object $mixin
bool $replace

Return Value

void

Exceptions

ReflectionException

in Macroable at line 61
static bool hasMacro(string $name)

Check if macro is registered.

Parameters

string $name

Return Value

bool

in Macroable at line 72
static void flushMacros()

Flush the existing macros.

Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.

Return Value

void

in Macroable at line 83
static mixed __callStatic(string $method, array $parameters)

Dynamically handle calls to the class.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 1744
mixed __call(string $method, array $parameters)

Dynamically bind parameters to the message.

Parameters

string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

at line 169
SentMessage|null send(Factory|Mailer $mailer)

Send the message using the given mailer.

Parameters

Factory|Mailer $mailer

Return Value

SentMessage|null

at line 193
mixed queue(Factory $queue)

Queue the message for sending.

Parameters

Factory $queue

Return Value

mixed

at line 222
mixed later(DateInterval|DateTimeInterface|int $delay, Factory $queue)

Deliver the queued message after (n) seconds.

Parameters

DateInterval|DateTimeInterface|int $delay
Factory $queue

Return Value

mixed

at line 250
protected mixed newQueuedJob()

Make the queued mailable job instance.

Return Value

mixed

at line 270
string render()

Render the mailable into a view.

Return Value

string

Exceptions

ReflectionException

at line 293
protected array|string buildView()

Build the view for the message.

Return Value

array|string

Exceptions

ReflectionException

at line 325
protected array buildMarkdownView()

Build the Markdown view for the message.

Return Value

array

Exceptions

ReflectionException

at line 340
array buildViewData()

Build the view data for the message.

Return Value

array

Exceptions

ReflectionException

at line 362
protected array additionalMessageData()

Get additional meta-data to pass along with the view data.

Return Value

array

at line 372
protected Closure buildMarkdownHtml(array $viewData)

Build the HTML view for a Markdown message.

Parameters

array $viewData

Return Value

Closure

at line 384
protected Closure buildMarkdownText(array $viewData)

Build the text view for a Markdown message.

Parameters

array $viewData

Return Value

Closure

at line 403
protected string markdownTheme()

Resolve the Markdown theme for this message.

Return Value

string

at line 416
protected Mailable buildFrom(Message $message)

Add the sender to the message.

Parameters

Message $message

Return Value

Mailable

at line 430
protected Mailable buildRecipients(Message $message)

Add all of the recipients to the message.

Parameters

Message $message

Return Value

Mailable

at line 446
protected Mailable buildSubject(Message $message)

Set the subject for the message.

Parameters

Message $message

Return Value

Mailable

at line 462
protected Mailable buildAttachments(Message $message)

Add all of the attachments to the message.

Parameters

Message $message

Return Value

Mailable

at line 484
protected void buildDiskAttachments(Message $message)

Add all of the disk attachments to the message.

Parameters

Message $message

Return Value

void

at line 515
protected Mailable buildTags(Message $message)

Add all defined tags to the message.

Parameters

Message $message

Return Value

Mailable

at line 531
protected Mailable buildMetadata(Message $message)

Add all defined metadata to the message.

Parameters

Message $message

Return Value

Mailable

at line 547
protected Mailable runCallbacks(Message $message)

Run the callbacks for the message.

Parameters

Message $message

Return Value

Mailable

at line 561
Mailable locale(string|null $locale)

Set the locale of the message.

Parameters

string|null $locale

Return Value

Mailable

at line 575
Mailable priority(int $level = 3)

Set the priority of this message.

The value is an integer where 1 is the highest priority and 5 is the lowest.

Parameters

int $level

Return Value

Mailable

at line 589
Mailable from(array|object|string $address, string|null $name = null)

Set the sender of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 597
bool hasFrom(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 607
Mailable to(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 619
bool hasTo(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 629
Mailable cc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 637
bool hasCc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 647
Mailable bcc(array|object|string $address, string|null $name = null)

Set the recipients of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 655
bool hasBcc(array|object|string $address, string|null $name = null)

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 665
Mailable replyTo(array|object|string $address, string|null $name = null)

Set the "reply to" address of the message.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 673
bool hasReplyTo(array|object|string $address, string|null $name = null)

Determine if the given replyTo is set on the mailable.

Parameters

array|object|string $address
string|null $name

Return Value

bool

at line 685
protected Mailable setAddress(array|object|string $address, string|null $name = null, string $property = 'to')

Set the recipients of the message.

All recipients are stored internally as [['name' => ?, 'address' => ?]]

Parameters

array|object|string $address
string|null $name
string $property

Return Value

Mailable

at line 713
protected array addressesToArray(array|object|string $address, string|null $name)

Convert the given recipient arguments to an array.

Parameters

array|object|string $address
string|null $name

Return Value

array

at line 727
protected object normalizeRecipient(mixed $recipient)

Convert the given recipient into an object.

Parameters

mixed $recipient

Return Value

object

at line 756
protected bool hasRecipient(array|object|string $address, string|null $name = null, string $property = 'to')

Determine if the given recipient is set on the mailable.

Parameters

array|object|string $address
string|null $name
string $property

Return Value

bool

at line 807
Mailable subject(string $subject)

Set the subject of the message.

Parameters

string $subject

Return Value

Mailable

at line 817
bool hasSubject(string $subject)

Determine if the mailable has the given subject.

Parameters

string $subject

Return Value

bool

at line 828
Mailable markdown(string $view, array $data = [])

Set the Markdown template for the message.

Parameters

string $view
array $data

Return Value

Mailable

at line 841
Mailable view(string $view, array $data = [])

Set the view and view data for the message.

Parameters

string $view
array $data

Return Value

Mailable

at line 854
Mailable html(string $html)

Set the rendered HTML content for the message.

Parameters

string $html

Return Value

Mailable

at line 866
Mailable text(string $textView, array $data = [])

Set the plain text view for the message.

Parameters

string $textView
array $data

Return Value

Mailable

at line 879
Mailable with(array|string $key, mixed $value = null)

Set the view data for the message.

Parameters

array|string $key
mixed $value

Return Value

Mailable

at line 895
Mailable attach(Attachable|Attachment|string $file, array $options = [])

Attach a file to the message.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

Mailable

at line 918
Mailable attachMany(array $files)

Attach multiple files to the message.

Parameters

array $files

Return Value

Mailable

at line 934
bool hasAttachment(Attachable|Attachment|string $file, array $options = [])

Determine if the mailable has the given attachment.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

bool

at line 988
Mailable attachFromStorage(string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

Parameters

string $path
string|null $name
array $options

Return Value

Mailable

at line 998
Mailable attachFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Attach a file to the message from storage.

Parameters

string|null $disk
string $path
string|null $name
array $options

Return Value

Mailable

at line 1015
bool hasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from storage.

Parameters

string $path
string|null $name
array $options

Return Value

bool

at line 1023
bool hasAttachmentFromStorageDisk(string|null $disk, string $path, string|null $name = null, array $options = [])

Determine if the mailable has the given attachment from a specific storage disk.

Parameters

string|null $disk
string $path
string|null $name
array $options

Return Value

bool

at line 1038
Mailable attachData(string $data, string $name, array $options = [])

Attach in-memory data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

Mailable

at line 1051
bool hasAttachedData(string $data, string|null $name, array $options = [])

Determine if the mailable has the given data as an attachment.

Parameters

string $data
string|null $name
array $options

Return Value

bool

at line 1065
Mailable tag(string $value)

Add a tag header to the message when supported by the underlying transport.

Parameters

string $value

Return Value

Mailable

at line 1075
bool hasTag(string $value)

Determine if the mailable has the given tag.

Parameters

string $value

Return Value

bool

at line 1086
Mailable metadata(array|string $key, int|string|null $value = null)

Add a metadata header to the message when supported by the underlying transport.

Parameters

array|string $key
int|string|null $value

Return Value

Mailable

at line 1100
bool hasMetadata(string $key, int|string $value)

Determine if the mailable has the given metadata.

Parameters

string $key
int|string $value

Return Value

bool

at line 1111
Mailable assertFrom(array|object|string $address, string|null $name = null)

Assert that the mailable is from the given address.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1131
Mailable assertTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1151
Mailable assertHasTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1161
Mailable assertHasCc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1181
Mailable assertHasBcc(array|object|string $address, string|null $name = null)

Assert that the mailable has the given recipient.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1201
Mailable assertHasReplyTo(array|object|string $address, string|null $name = null)

Assert that the mailable has the given "reply to" address.

Parameters

array|object|string $address
string|null $name

Return Value

Mailable

at line 1256
Mailable assertHasSubject(string $subject)

Assert that the mailable has the given subject.

Parameters

string $subject

Return Value

Mailable

at line 1276
Mailable assertSeeInHtml(string $string, bool $escape = true)

Assert that the given text is present in the HTML email body.

Parameters

string $string
bool $escape

Return Value

Mailable

at line 1296
Mailable assertDontSeeInHtml(string $string, bool $escape = true)

Assert that the given text is not present in the HTML email body.

Parameters

string $string
bool $escape

Return Value

Mailable

at line 1317
Mailable assertSeeInOrderInHtml(array $strings, bool $escape = true)

Assert that the given text strings are present in order in the HTML email body.

Parameters

array $strings
bool $escape

Return Value

Mailable

at line 1335
Mailable assertSeeInText(string $string)

Assert that the given text is present in the plain-text email body.

Parameters

string $string

Return Value

Mailable

at line 1353
Mailable assertDontSeeInText(string $string)

Assert that the given text is not present in the plain-text email body.

Parameters

string $string

Return Value

Mailable

at line 1372
Mailable assertSeeInOrderInText(array $strings)

Assert that the given text strings are present in order in the plain-text email body.

Parameters

array $strings

Return Value

Mailable

at line 1386
Mailable assertHasNoAttachments()

Assert the mailable has no attachments.

Return Value

Mailable

at line 1411
Mailable assertHasAttachment(Attachable|Attachment|string $file, array $options = [])

Assert the mailable has the given attachment.

Parameters

Attachable|Attachment|string $file
array $options

Return Value

Mailable

at line 1428
Mailable assertHasAttachedData(string $data, string $name, array $options = [])

Assert the mailable has the given data as an attachment.

Parameters

string $data
string $name
array $options

Return Value

Mailable

at line 1445
Mailable assertHasAttachmentFromStorage(string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from storage.

Parameters

string $path
string|null $name
array $options

Return Value

Mailable

at line 1462
Mailable assertHasAttachmentFromStorageDisk(string $disk, string $path, string|null $name = null, array $options = [])

Assert the mailable has the given attachment from a specific storage disk.

Parameters

string $disk
string $path
string|null $name
array $options

Return Value

Mailable

at line 1479
Mailable assertHasTag(string $tag)

Assert that the mailable has the given tag.

Parameters

string $tag

Return Value

Mailable

at line 1498
Mailable assertHasMetadata(string $key, int|string $value)

Assert that the mailable has the given metadata.

Parameters

string $key
int|string $value

Return Value

Mailable

at line 1518
protected array renderForAssertions()

Render the HTML and plain-text version of the mailable into views for assertions.

Return Value

array

Exceptions

ReflectionException

at line 1557
protected void prepareMailableForDelivery()

Prepare the mailable instance for delivery.

Return Value

void

at line 1689
bool usesMailer(string $mailer)

Determine if the mailable will be sent by the given mailer.

Parameters

string $mailer

Return Value

bool

at line 1699
Mailable mailer(string|null $mailer)

Set the name of the mailer that should send the message.

Parameters

string|null $mailer

Return Value

Mailable

at line 1711
Mailable withSymfonyMessage(callable $callback)

Register a callback to be called with the Symfony message instance.

Parameters

callable $callback

Return Value

Mailable

at line 1724
static void buildViewDataUsing(callable $callback)

Register a callback to be called while building the view data.

The callback persists in a static property for the worker lifetime and runs on every Mailable render across all coroutines.

Parameters

callable $callback

Return Value

void

at line 1733
static void flushState()

Flush all static state.

Return Value

void