Notification
class Notification implements Arrayable (View source)
Traits
SerializesModels |
Properties
Collection | $notifiables | The entities that should receive the notification. | |
$via | The channels that the notification should be sent through. | ||
string | $application | The name of the application sending the notification. | |
string | $logoUrl | The URL to the application's logo. | |
string | $level | The "level" of the notification (info, success, error). | |
string | $subject | The subject of the notification. | |
array | $introLines | The "intro" lines of the notification. | |
array | $outroLines | The "outro" lines of the notification. | |
string | $actionText | The text / label for the action. | |
string | $actionUrl | The action URL. | |
array | $options | The notification's options. |
Methods
array | __sleep() Prepare the instance for serialization. | from SerializesModels |
void | __wakeup() Restore the model after serialization. | from SerializesModels |
mixed | getSerializedPropertyValue(mixed $value) Get the property value prepared for serialization. | from SerializesModels |
mixed | getRestoredPropertyValue(mixed $value) Get the restored property value after deserialization. | from SerializesModels |
Collection | restoreCollection(ModelIdentifier $value) Restore a queueable collection instance. | from SerializesModels |
mixed | getPropertyValue(ReflectionProperty $property) Get the property value for the given property. | from SerializesModels |
void | __construct(Collection|array|mixed $notifiables) Create a new notification instance. | |
$this | application(string $application, string $logoUrl = null) Specify the name of the application sending the notification. | |
$this | success() Indicate that the notification gives information about a successful operation. | |
$this | error() Indicate that the notification gives information about an error. | |
$this | level(string $level) Set the "level" of the notification (success, error, etc.). | |
$this | subject(string $subject) Set the subject of the notification. | |
$this | line(Action|string $line) Add a line of text to the notification. | |
$this | with(Action|string $line) Add a line of text to the notification. | |
$this | options(array $options) Set the notification's options. | |
$this | action(string $text, string $url) Configure the "call to action" button. | |
$this | via(array|string $channels) Set the channels that should be used to deliver the notification. | |
void | send() Send the notification. | |
static array[static] | notificationsFromInstance(mixed $notifiable, mixed $instance, array|null $channels = null) Build new channel notifications from the given object. | |
static Notification | buildNotification(mixed $notifiable, mixed $instance, string $channel) Build a new channel notification. | |
static string | messageMethod(mixed $instance, string $channel) Get the proper message method for the given instance and channel. | |
static string | optionsMethod(mixed $instance, string $channel) Get the proper data method for the given instance and channel. | |
array | toArray() Get the instance as an array. |
Details
array __sleep()
Prepare the instance for serialization.
void __wakeup()
Restore the model after serialization.
protected mixed getSerializedPropertyValue(mixed $value)
Get the property value prepared for serialization.
protected mixed getRestoredPropertyValue(mixed $value)
Get the restored property value after deserialization.
protected Collection restoreCollection(ModelIdentifier $value)
Restore a queueable collection instance.
protected mixed getPropertyValue(ReflectionProperty $property)
Get the property value for the given property.
void __construct(Collection|array|mixed $notifiables)
Create a new notification instance.
$this application(string $application, string $logoUrl = null)
Specify the name of the application sending the notification.
$this success()
Indicate that the notification gives information about a successful operation.
$this error()
Indicate that the notification gives information about an error.
$this level(string $level)
Set the "level" of the notification (success, error, etc.).
$this subject(string $subject)
Set the subject of the notification.
$this line(Action|string $line)
Add a line of text to the notification.
$this with(Action|string $line)
Add a line of text to the notification.
$this options(array $options)
Set the notification's options.
$this action(string $text, string $url)
Configure the "call to action" button.
$this via(array|string $channels)
Set the channels that should be used to deliver the notification.
void send()
Send the notification.
static array[static] notificationsFromInstance(mixed $notifiable, mixed $instance, array|null $channels = null)
Build new channel notifications from the given object.
static protected Notification buildNotification(mixed $notifiable, mixed $instance, string $channel)
Build a new channel notification.
static protected string messageMethod(mixed $instance, string $channel)
Get the proper message method for the given instance and channel.
static protected string optionsMethod(mixed $instance, string $channel)
Get the proper data method for the given instance and channel.
array toArray()
Get the instance as an array.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.6/Illuminate/Notifications/Channels/Notification.html