File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -142,15 +142,15 @@ private function buildNode($result, $resultMap): array
142
142
// Create a node with 'name' and 'value' attributes
143
143
$ node = [
144
144
'name ' => $ result ->{$ this ->getTitleAttribute ()},
145
- 'value ' => $ result ->id ,
146
- 'disabled ' => in_array ($ result ->id , $ this ->getDisabledOptions ()),
145
+ 'value ' => $ result ->getKey () ,
146
+ 'disabled ' => in_array ($ result ->getKey () , $ this ->getDisabledOptions ()),
147
147
];
148
148
149
149
// Check if the result has children
150
- if (isset ($ resultMap [$ result ->id ])) {
150
+ if (isset ($ resultMap [$ result ->getKey () ])) {
151
151
$ children = collect ();
152
152
// Recursively build child nodes
153
- foreach ($ resultMap [$ result ->id ] as $ child ) {
153
+ foreach ($ resultMap [$ result ->getKey () ] as $ child ) {
154
154
$ childNode = $ this ->buildNode ($ child , $ resultMap );
155
155
$ children ->push ($ childNode );
156
156
}
You can’t perform that action at this time.
0 commit comments