Skip to content

Commit 9837954

Browse files
committed
formatting
1 parent e7d534e commit 9837954

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Illuminate/Database/Eloquent/Collection.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -665,10 +665,10 @@ public function getQueueableClass()
665665
return;
666666
}
667667

668-
$class = $this->getModelClass($this->first());
668+
$class = $this->getQueueableModelClass($this->first());
669669

670670
$this->each(function ($model) use ($class) {
671-
if ($this->getModelClass($model) !== $class) {
671+
if ($this->getQueueableModelClass($model) !== $class) {
672672
throw new LogicException('Queueing collections with multiple model types is not supported.');
673673
}
674674
});
@@ -677,17 +677,16 @@ public function getQueueableClass()
677677
}
678678

679679
/**
680-
* Get the identifiers for a single entity.
680+
* Get the queueable class name for the given model.
681681
*
682+
* @param \Illuminate\Database\Eloquent\Model $model
682683
* @return string
683684
*/
684-
protected function getModelClass($model)
685+
protected function getQueueableModelClass($model)
685686
{
686-
if (method_exists($model, 'getClassNameForSerialization')) {
687-
return $model->getClassNameForSerialization();
688-
}
689-
690-
return get_class($model);
687+
return method_exists($model, 'getQueueableClassName')
688+
? $model->getQueueableClassName()
689+
: get_class($model);
691690
}
692691

693692
/**

0 commit comments

Comments
 (0)