Skip to content

Commit ae24548

Browse files
author
Shashank Jain
committed
Fix: belongs to relation key
1 parent f39e9f6 commit ae24548

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/RequestParser.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ private function parseFields($fields)
428428
$fieldParts = explode(".", $fieldName);
429429

430430
if ($relation instanceof BelongsTo) {
431-
$singular = $relation->getOtherKey();
431+
$singular = $relation->getForeignKey();
432432
}
433433
else if ($relation instanceof HasOne || $relation instanceof HasMany) {
434434
$singular = explode('.', $relation->getForeignKey())[1];
@@ -456,6 +456,8 @@ private function parseFields($fields)
456456
else {
457457
$this->relations[$parent]["fields"][] = $singular;
458458
}
459+
460+
\Log::debug($this->relations[$parent]);
459461
}
460462
else {
461463

0 commit comments

Comments
 (0)