diff --git a/src/Illuminate/Foundation/Bus/PendingChain.php b/src/Illuminate/Foundation/Bus/PendingChain.php index 63cd3222e66a..5931fb3202b2 100644 --- a/src/Illuminate/Foundation/Bus/PendingChain.php +++ b/src/Illuminate/Foundation/Bus/PendingChain.php @@ -143,10 +143,21 @@ public function dispatch() $firstJob = $this->job; } - $firstJob->allOnConnection($this->connection); - $firstJob->allOnQueue($this->queue); + if ($this->connection) { + $firstJob->chainConnection = $this->connection; + $firstJob->connection = $firstJob->connection ?: $this->connection; + } + + if ($this->queue) { + $firstJob->chainQueue = $this->queue; + $firstJob->queue = $firstJob->queue ?: $this->queue; + } + + if ($this->delay) { + $firstJob->delay = ! is_null($firstJob->delay) ? $firstJob->delay : $this->delay; + } + $firstJob->chain($this->chain); - $firstJob->delay($this->delay); $firstJob->chainCatchCallbacks = $this->catchCallbacks(); return app(Dispatcher::class)->dispatch($firstJob);