Skip to content

Commit

Permalink
Merge pull request #237 from nikosv/main
Browse files Browse the repository at this point in the history
Fix for Select and model's relationships
  • Loading branch information
freekmurze authored Jul 15, 2024
2 parents 2b3d8e1 + fef115b commit c20cc9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Elements/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ protected function hasSelection()

protected function applyValueToOptions()
{
$value = Collection::make($this->value);
$value = $this->value instanceof \Illuminate\Support\Collection
? $this->value
: Collection::make($this->value);

if (! $this->hasAttribute('multiple')) {
$value = $value->take(1);
Expand Down

0 comments on commit c20cc9f

Please sign in to comment.