Skip to content

Commit 8b4348a

Browse files
committed
unshift is better than rest
1 parent c0ca34d commit 8b4348a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Console/ModelsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public function getPropertiesFromMethods($model)
731731
if ($existingPivot = ($this->properties[$relationObj->getPivotAccessor()] ?? null)) {
732732
$existingClasses = explode('|', $existingPivot['type']);
733733
if(!in_array($pivot, $existingClasses)) {
734-
$existingClasses = [$pivot, ...$existingClasses];
734+
array_unshift($existingClasses, $pivot);
735735
}
736736
} else {
737737
// No existing pivot property, so we need to add a null type

0 commit comments

Comments
 (0)