Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Include dispatchSync in the DispatchesJobs trait #37063

Merged
merged 3 commits into from Apr 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
}