Skip to content

Commit

Permalink
Update FunctionsTrait.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Gevor701069 authored Mar 10, 2020
1 parent f0f57cd commit cbc73b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Traits/FunctionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' && $method !== 'orderBy') {
if ($method !== 'whereIn' && ($method !== 'orderBy' || ($method === 'orderBy' && is_string($option)))) {
$option = [$relOption];
}

Expand Down

0 comments on commit cbc73b2

Please sign in to comment.