Notifications

Send notifications via mail, database, and Slack

Notifications let you alert users across multiple channels from a single class.

A notification defines which channels it should be sent through: mail, database, Slack, and more.

Notification
InvoicePaid
Mail
Database
Slack
via() returns
maildatabaseslack
PHP
class InvoicePaid extends Notification {
    use Queueable;

    public function __construct(
        public Invoice $invoice
    ) {}

    public function via(object $notifiable): array {
        return ['mail', 'database', 'slack'];
    }
}