Laravel

Laravel Notifications: Multi-Channel Messages

December 24, 2025 1 min read 32 views

Multi-channel notifications:

Create Notification

class OrderShipped extends Notification
{
    public function via($notifiable)
    {
        return ['mail', 'database', 'slack'];
    }

    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->line('Your order has shipped!');
    }
}

Send Notification

$user->notify(new OrderShipped($order));

Queue Notifications

class OrderShipped extends Notification implements ShouldQueue
{
    // Automatically queued
}
Share this post:

Related Posts

Comments (0)

Please log in to leave a comment. Log in

No comments yet. Be the first to comment!