Skip to content

Commit 462cd8e

Browse files
committed
Get The model key if no custom key is set
1 parent 3481966 commit 462cd8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SelectTree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SelectTree extends Field implements HasAffixActions
3737

3838
protected bool $independent = true;
3939

40-
protected string $customKey = 'id';
40+
protected string $customKey = null;
4141

4242
protected string $titleAttribute;
4343

@@ -360,7 +360,7 @@ public function getIndependent(): bool
360360

361361
public function getCustomKey(): string
362362
{
363-
return $this->evaluate($this->customKey);
363+
return $this->customKey ? $this->evaluate($this->customKey) : $this->getKey();
364364
}
365365

366366
public function getWithCount(): bool

0 commit comments

Comments
 (0)