class Content (View source)

Traits

Properties

string|null $view

The Blade view that should be rendered for the mailable.

string|null $html

The Blade view that should be rendered for the mailable.

string|null $text

The Blade view that represents the text version of the message.

string|null $markdown

The Blade view that represents the Markdown version of the message.

string|null $htmlString

The pre-rendered HTML of the message.

array $with

The message's view data.

Methods

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

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

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

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

__construct(string $view = null, string $html = null, string $text = null, string|null $markdown = null, array $with = [], string $htmlString = null)

Create a new content definition.

$this
view(string $view)

Set the view for the message.

$this
html(string $view)

Set the view for the message.

$this
text(string $view)

Set the plain text view for the message.

$this
markdown(string $view)

Set the Markdown view for the message.

$this
htmlString(string $html)

Set the pre-rendered HTML for the message.

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

Add a piece of view data to the message.

Details

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

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

Parameters

$value
callable $callback
callable $default

Return Value

$this|TWhenReturnType

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

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

Parameters

$value
callable $callback
callable $default

Return Value

$this|TUnlessReturnType

__construct(string $view = null, string $html = null, string $text = null, string|null $markdown = null, array $with = [], string $htmlString = null)

Create a new content definition.

Parameters

string $view
string $html
string $text
string|null $markdown
array $with
string $htmlString

$this view(string $view)

Set the view for the message.

Parameters

string $view

Return Value

$this

$this html(string $view)

Set the view for the message.

Parameters

string $view

Return Value

$this

$this text(string $view)

Set the plain text view for the message.

Parameters

string $view

Return Value

$this

$this markdown(string $view)

Set the Markdown view for the message.

Parameters

string $view

Return Value

$this

$this htmlString(string $html)

Set the pre-rendered HTML for the message.

Parameters

string $html

Return Value

$this

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

Add a piece of view data to the message.

Parameters

array|string $key
mixed|null $value

Return Value

$this