Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit e1ef10a

Browse files
committed
Attributable::relationsToArray() doesn't return entity attributes
1 parent 5aff4ae commit e1ef10a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Traits/Attributable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ public function relationsToArray()
118118
$relations = array_keys($this->getEntityAttributeRelations());
119119

120120
foreach ($relations as $relation) {
121-
if (array_key_exists($relation, $attributes)) {
122-
$eavAttributes[$relation] = $this->getAttribute($relation) instanceof BaseCollection
123-
? $this->getAttribute($relation)->toArray() : $this->getAttribute($relation);
121+
$eavAttributes[$relation] = $this->getAttribute($relation) instanceof BaseCollection
122+
? $this->getAttribute($relation)->toArray() : $this->getAttribute($relation);
124123

124+
if (array_key_exists($relation, $attributes)) {
125125
// By unsetting the relation from the attributes array we will make
126126
// sure we do not provide a duplicity when adding the namespace.
127127
// Otherwise it would keep the relation as a key in the root.

0 commit comments

Comments
 (0)