Multi-channel notifications:
Create Notification
php artisan make:notification OrderShippedNotification 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));