Notifiables
A Notifiable
is a something that can recieve a notification. Traditionally it is your User
object, but it isn't limited to that. You may send notifications to a Team
, a MailingList
, a Site
, or more.
INotifiable
A Notifiable
needs to implement the INotifiable
interface (implements
keyword optional).
An example implementation for a User
component could be as follows:
via
Notifiable
instances are passed to the via
method on a Notification
. This is to allow you to customize the channels used to each Notifiable
. You may choose certain channels for a certain Notifiable
type, like only sending SMS messages to User
instances, not Team
instances. You can also store Notifiable
-specific configuration, like allowing a User
to opt-in to certain channels like sms
, email
, or slack
.
See the via
docs on Notifications
for more information.
routeNotificationFor
Providers may look for a routeNotificationFor
method suffixed with the Provider type name. For instance, the EmailProvider
may look for a routeNotificationForEmail
method on the Notifiable
.
See the Provider-specific docs for more information.
Last updated