Skip to content

Commit 070fe43

Browse files
authored
Fixed falsely migrated code section
When adding eager loaded relations to the default resource this code would cause errors in certain scenarios.
1 parent 56b78a7 commit 070fe43

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Matthenning/EloquentApiFilter/Resource.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@ public function enrich($data): array
3737
{
3838
foreach ($this->getRelationNames() as $relation=>$relationClass) {
3939
if ($this->resource->relationLoaded($relation)) {
40-
if (isset(($this->resource->$relation)::$resourceName) && ($this->resource->$relation)::$resourceName != null) {
41-
$data[$relation] = new (($this->resource->$relation)::$resourceName)($this->resource->$relation);
42-
} else {
43-
$data[$relation] = $this->resource->$relation;
44-
}
40+
$data[$relation] = $this->resource->$relation;
4541
}
4642
}
4743

0 commit comments

Comments
 (0)