Skip to content

Commit

Permalink
[8.x] Include dispatchSync in the DispatchesJobs trait (#37063)
Browse files Browse the repository at this point in the history
* Update DispatchesJobs.php

Include new dispatchSync

* Update DispatchesJobs.php

* add deprecation notice
  • Loading branch information
JacobBennett committed Apr 20, 2021
1 parent c607db9 commit f79b684
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Illuminate/Foundation/Bus/DispatchesJobs.php
Expand Up @@ -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);
}
}

0 comments on commit f79b684

Please sign in to comment.