Skip to content

Commit

Permalink
Merge pull request #86 from tailflow/hotfix/resolving-relation-from-p…
Browse files Browse the repository at this point in the history
…aram-constraint

fix: resolving relation from param constraint
  • Loading branch information
alexzarbn authored May 17, 2021
2 parents c03e9d6 + 05c780f commit 81f4113
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Drivers/Standard/RelationsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ public function requestedRelations(Request $request): array
public function relationFromParamConstraint(string $paramConstraint): string
{
$paramConstraintParts = explode('.', $paramConstraint);
if (count($paramConstraintParts) === 2) {
return Arr::first($paramConstraintParts);
}

return implode('.', array_slice($paramConstraintParts, -1));
return implode('.', array_slice($paramConstraintParts, 0, count($paramConstraintParts) - 1));
}

/**
Expand Down

0 comments on commit 81f4113

Please sign in to comment.