From 2a2dce5afbad651eb58b00d975d265c308786035 Mon Sep 17 00:00:00 2001 From: Vignesh Gurusamy Date: Mon, 30 Sep 2019 19:15:28 +0530 Subject: [PATCH] Support job middleware for queued notifications (#30070) --- src/Illuminate/Notifications/NotificationSender.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Illuminate/Notifications/NotificationSender.php b/src/Illuminate/Notifications/NotificationSender.php index 8623c2442181..5ce2e3cefc76 100644 --- a/src/Illuminate/Notifications/NotificationSender.php +++ b/src/Illuminate/Notifications/NotificationSender.php @@ -193,6 +193,12 @@ protected function queueNotification($notifiables, $notification) ->onConnection($notification->connection) ->onQueue($notification->queue) ->delay($notification->delay) + ->through( + array_merge( + method_exists($notification, 'middleware') ? $notification->middleware() : [], + $notification->middleware ?? [] + ) + ) ); } }