Skip to content

Commit

Permalink
Merge branch '3.x' of https://github.com/filamentphp/filament into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Aug 29, 2023
2 parents 67ceed6 + 3957b34 commit 94a3046
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/forms/src/Components/MorphToSelect/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ protected function setUp(): void
]) ?? $query;
}

if (empty($query->getQuery()->orders)) {
$query->orderBy($this->getTitleAttribute());
}

$isFirst = true;
$isForcedCaseInsensitive = $this->isSearchForcedCaseInsensitive($query);

Expand Down Expand Up @@ -113,8 +109,14 @@ protected function setUp(): void
->toArray();
}

$titleAttribute = $this->getTitleAttribute();

if (empty($query->getQuery()->orders)) {
$query->orderBy($titleAttribute);
}

return $query
->pluck($this->getTitleAttribute(), $keyName)
->pluck($titleAttribute, $keyName)
->toArray();
});

Expand All @@ -131,10 +133,6 @@ protected function setUp(): void
]) ?? $query;
}

if (empty($query->getQuery()->orders)) {
$query->orderBy($this->getTitleAttribute());
}

$keyName = $query->getModel()->getKeyName();

if ($this->hasOptionLabelFromRecordUsingCallback()) {
Expand All @@ -146,8 +144,14 @@ protected function setUp(): void
->toArray();
}

$titleAttribute = $this->getTitleAttribute();

if (empty($query->getQuery()->orders)) {
$query->orderBy($titleAttribute);
}

return $query
->pluck($this->getTitleAttribute(), $keyName)
->pluck($titleAttribute, $keyName)
->toArray();
});

Expand Down

0 comments on commit 94a3046

Please sign in to comment.