MailFake

class MailFake implements Mailer (View source)

Properties

protected array $mailables All of the mailables that have been sent.

Methods

void assertSent(string $mailable, callable|null $callback = null)

Assert if a mailable was sent based on a truth-test callback.

void assertSentTo(mixed $users, string $mailable, callable|null $callback = null)

Assert if a mailable was sent based on a truth-test callback.

Collection formatRecipients(mixed $recipients)

Format the recipients into a collection.

bool recipientsMatch(Collection $expected, Collection $recipients)

Determine if two given recipient lists match.

void assertNotSent(string $mailable, callable|null $callback = null)

Determine if a mailable was sent based on a truth-test callback.

Collection sent(string $mailable, callable|null $callback = null)

Get all of the mailables matching a truth-test callback.

bool hasSent(string $mailable)

Determine if the given mailable has been sent.

Collection mailablesOf(string $type)

Get all of the mailed mailables for a given type.

MailableMailer to(mixed $users)

Begin the process of mailing a mailable class instance.

MailableMailer bcc(mixed $users)

Begin the process of mailing a mailable class instance.

int raw(string $text, Closure|string $callback)

Send a new message when only a raw text part.

void send(string|array $view, array $data = [], Closure|string $callback = null)

Send a new message using a view.

array failures()

Get the array of failed recipients.

mixed queue(string|array $view, array $data = [], Closure|string $callback = null, string|null $queue = null)

Queue a new e-mail message for sending.

Details

void assertSent(string $mailable, callable|null $callback = null)

Assert if a mailable was sent based on a truth-test callback.

Parameters

string $mailable
callable|null $callback

Return Value

void

void assertSentTo(mixed $users, string $mailable, callable|null $callback = null)

Assert if a mailable was sent based on a truth-test callback.

Parameters

mixed $users
string $mailable
callable|null $callback

Return Value

void

protected Collection formatRecipients(mixed $recipients)

Format the recipients into a collection.

Parameters

mixed $recipients

Return Value

Collection

protected bool recipientsMatch(Collection $expected, Collection $recipients)

Determine if two given recipient lists match.

Parameters

Collection $expected
Collection $recipients

Return Value

bool

void assertNotSent(string $mailable, callable|null $callback = null)

Determine if a mailable was sent based on a truth-test callback.

Parameters

string $mailable
callable|null $callback

Return Value

void

Collection sent(string $mailable, callable|null $callback = null)

Get all of the mailables matching a truth-test callback.

Parameters

string $mailable
callable|null $callback

Return Value

Collection

bool hasSent(string $mailable)

Determine if the given mailable has been sent.

Parameters

string $mailable

Return Value

bool

protected Collection mailablesOf(string $type)

Get all of the mailed mailables for a given type.

Parameters

string $type

Return Value

Collection

MailableMailer to(mixed $users)

Begin the process of mailing a mailable class instance.

Parameters

mixed $users

Return Value

MailableMailer

MailableMailer bcc(mixed $users)

Begin the process of mailing a mailable class instance.

Parameters

mixed $users

Return Value

MailableMailer

int raw(string $text, Closure|string $callback)

Send a new message when only a raw text part.

Parameters

string $text
Closure|string $callback

Return Value

int

void send(string|array $view, array $data = [], Closure|string $callback = null)

Send a new message using a view.

Parameters

string|array $view
array $data
Closure|string $callback

Return Value

void

array failures()

Get the array of failed recipients.

Return Value

array

mixed queue(string|array $view, array $data = [], Closure|string $callback = null, string|null $queue = null)

Queue a new e-mail message for sending.

Parameters

string|array $view
array $data
Closure|string $callback
string|null $queue

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Support/Testing/Fakes/MailFake.html