diff --git a/src/Traits/FunctionsTrait.php b/src/Traits/FunctionsTrait.php index ac2ee4b..2bbdee5 100644 --- a/src/Traits/FunctionsTrait.php +++ b/src/Traits/FunctionsTrait.php @@ -147,7 +147,7 @@ protected function with($relation, $relOptions, string $type = 'with') foreach ($relOptions as $relOptionName => $relOption) { $method = $this->clearRelationOption($relOptionName); $option = $relOption; - if ($method !== 'whereIn') { + if ($method !== 'whereIn' && $method !== 'orderBy') { $option = [$relOption]; }