abstract class Notification

Base Notification class similar to Laravel's.

Extend this for each specific notification type.

Methods

static array
channels()

Get an array of available channels.

static array
channelValues()

Returns list of all channels as an array of strings.

array
toArray(object $notifiable)

Generic array representation (fallback for logging, webhooks, etc.).

array
toDatabase(object $notifiable)

Representation of the notification in the database.

string
toLog(object $notifiable)

Representation of the notification in logging.

array
toMail(object $notifiable)

Representation of the notification in mail.

array
via(object $notifiable)

The delivery channels (e.g. ['database', 'mail']).

Details

at line 16
static array channels()

Get an array of available channels.

Return Value

array

The array of channels.

at line 25
static array channelValues()

Returns list of all channels as an array of strings.

Return Value

array

An array of channels as strings.

at line 36
array toArray(object $notifiable)

Generic array representation (fallback for logging, webhooks, etc.).

By default, defer to the database payload.

Parameters

object $notifiable

Any model/object that uses the Notifiable trait.

Return Value

array

at line 47
array toDatabase(object $notifiable)

Representation of the notification in the database.

Parameters

object $notifiable

Any model/object that uses the Notifiable trait.

Return Value

array

at line 57
string toLog(object $notifiable)

Representation of the notification in logging.

Parameters

object $notifiable

Any model/object that uses the Notifiable trait.

Return Value

string

Contents for the log.

at line 67
array toMail(object $notifiable)

Representation of the notification in mail.

Parameters

object $notifiable

Any model/object that uses the Notifiable trait.

Return Value

array array<string,mixed>

at line 76
array via(object $notifiable)

The delivery channels (e.g. ['database', 'mail']).

Parameters

object $notifiable

Any model/object that uses the Notifiable trait.

Return Value

array