diff --git a/src/Drivers/Standard/RelationsResolver.php b/src/Drivers/Standard/RelationsResolver.php index 2ac76f3b..e1760771 100644 --- a/src/Drivers/Standard/RelationsResolver.php +++ b/src/Drivers/Standard/RelationsResolver.php @@ -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)); } /**