diff --git a/src/Illuminate/Queue/Jobs/JobName.php b/src/Illuminate/Queue/Jobs/JobName.php index 31f7048c4d79..5ebe90b0b904 100644 --- a/src/Illuminate/Queue/Jobs/JobName.php +++ b/src/Illuminate/Queue/Jobs/JobName.php @@ -27,8 +27,8 @@ public static function parse($job) */ public static function resolve($name, $payload) { - if (isset($payload['name']) && ! empty($payload['name'])) { - return $payload['name']; + if (isset($payload['displayName']) && ! empty($payload['displayName'])) { + return $payload['displayName']; } if ($name === 'Illuminate\Queue\CallQueuedHandler@call') { diff --git a/src/Illuminate/Queue/Queue.php b/src/Illuminate/Queue/Queue.php index b1aefee99d51..948c2cf408b0 100755 --- a/src/Illuminate/Queue/Queue.php +++ b/src/Illuminate/Queue/Queue.php @@ -117,9 +117,9 @@ protected function createPayloadArray($job, $data = '', $queue = null) protected function createObjectPayload($job) { return [ + 'displayName' => $this->getDisplayName($job), 'job' => 'Illuminate\Queue\CallQueuedHandler@call', 'maxTries' => isset($job->tries) ? $job->tries : null, - 'name' => $job instanceof CallQueuedListener ? $job->class : '', 'timeout' => isset($job->timeout) ? $job->timeout : null, 'data' => [ 'commandName' => get_class($job), @@ -128,6 +128,21 @@ protected function createObjectPayload($job) ]; } + /** + * Get the display name for the given job. + * + * @param mixed $job + * @return string + */ + protected function getDisplayName($job) + { + if ($job instanceof CallQueuedListener) { + return $job->class; + } + + return get_class($job); + } + /** * Create a typical, string based queue payload array. *