From f79b6843f5a1d87526e50d7a8205737aa7b85cc5 Mon Sep 17 00:00:00 2001 From: Jacob Bennett Date: Tue, 20 Apr 2021 13:08:59 -0500 Subject: [PATCH] [8.x] Include dispatchSync in the DispatchesJobs trait (#37063) * Update DispatchesJobs.php Include new dispatchSync * Update DispatchesJobs.php * add deprecation notice --- src/Illuminate/Foundation/Bus/DispatchesJobs.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Illuminate/Foundation/Bus/DispatchesJobs.php b/src/Illuminate/Foundation/Bus/DispatchesJobs.php index 46d6e5b4dba4..b1744031d723 100644 --- a/src/Illuminate/Foundation/Bus/DispatchesJobs.php +++ b/src/Illuminate/Foundation/Bus/DispatchesJobs.php @@ -22,9 +22,24 @@ protected function dispatch($job) * * @param mixed $job * @return mixed + * + * @deprecated Will be removed in a future Laravel version. */ 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); + } }