Skip to content

Commit 75f83b7

Browse files
authored
Update Select.php
1 parent c53875e commit 75f83b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Views/Components/Select.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct(
7575
}
7676

7777
if ($default instanceof Model) {
78-
$default = $default->getKey();
78+
$default = $idField ? $default->{$idField} : $default->getKey();
7979
}
8080

8181
$this->selectedKey = old($inputName, $default);

0 commit comments

Comments
 (0)