From 7200ab297a2db90ea91067f3685631bda90b980a Mon Sep 17 00:00:00 2001 From: Jacob Bennett Date: Tue, 20 Apr 2021 10:54:13 -0500 Subject: [PATCH 1/3] Update DispatchesJobs.php Include new dispatchSync --- src/Illuminate/Foundation/Bus/DispatchesJobs.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Illuminate/Foundation/Bus/DispatchesJobs.php b/src/Illuminate/Foundation/Bus/DispatchesJobs.php index 46d6e5b4dba4..e00e7dc89a32 100644 --- a/src/Illuminate/Foundation/Bus/DispatchesJobs.php +++ b/src/Illuminate/Foundation/Bus/DispatchesJobs.php @@ -27,4 +27,17 @@ public function dispatchNow($job) { return app(Dispatcher::class)->dispatchNow($job); } + + /** + * Dispatch a command to its appropriate handler in the current process. + * + * Queueable jobs will be dispatched to the "sync" queue. + * + * @param mixed $job + * @return mixed + */ + public function dispatchSync($job) + { + return app(Dispatcher::class)->dispatchSync($job); + } } From bb20fb112c97b7584345d560f5bb6ca30e1ed434 Mon Sep 17 00:00:00 2001 From: Jacob Bennett Date: Tue, 20 Apr 2021 10:58:51 -0500 Subject: [PATCH 2/3] Update DispatchesJobs.php --- src/Illuminate/Foundation/Bus/DispatchesJobs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Bus/DispatchesJobs.php b/src/Illuminate/Foundation/Bus/DispatchesJobs.php index e00e7dc89a32..8b2621e36587 100644 --- a/src/Illuminate/Foundation/Bus/DispatchesJobs.php +++ b/src/Illuminate/Foundation/Bus/DispatchesJobs.php @@ -27,7 +27,7 @@ public function dispatchNow($job) { return app(Dispatcher::class)->dispatchNow($job); } - + /** * Dispatch a command to its appropriate handler in the current process. * From 0f85ef986331cc0cfdc6b90617a6ef245bfca2c4 Mon Sep 17 00:00:00 2001 From: Jacob Bennett Date: Tue, 20 Apr 2021 12:27:51 -0500 Subject: [PATCH 3/3] add deprecation notice --- src/Illuminate/Foundation/Bus/DispatchesJobs.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Illuminate/Foundation/Bus/DispatchesJobs.php b/src/Illuminate/Foundation/Bus/DispatchesJobs.php index 8b2621e36587..b1744031d723 100644 --- a/src/Illuminate/Foundation/Bus/DispatchesJobs.php +++ b/src/Illuminate/Foundation/Bus/DispatchesJobs.php @@ -22,6 +22,8 @@ protected function dispatch($job) * * @param mixed $job * @return mixed + * + * @deprecated Will be removed in a future Laravel version. */ public function dispatchNow($job) {