Laravel Notifications: Multi-Channel Alerts
January 16, 2026
•
1 min read
•
14 views
Table of Contents
Multi-channel notifications:
Create Notification
php artisan make:notification OrderShipped
Notification Class
class OrderShipped extends Notification
{
public function via($notifiable)
{
return ['mail', 'database'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->line('Your order has shipped!')
->action('View Order', url('/orders/'.$this->order->id));
}
public function toArray($notifiable)
{
return ['order_id' => $this->order->id];
}
}
Send Notification
$user->notify(new OrderShipped($order));
Related Posts
Laravel Sanctum API Authentication Complete Guide
Build secure API authentication with Laravel Sanctum for SPAs and mobile apps.
Laravel Rate Limiting: Protect Your Application
Implement rate limiting to protect your Laravel application from abuse.
Laravel Blade Components: Build Reusable UI
Create powerful reusable components with Laravel Blade.
Comments (0)
No comments yet. Be the first to comment!