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
142142 // Create a node with 'name' and 'value' attributes
143143 $ node = [
144144 '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 ()),
147147 ];
148148
149149 // Check if the result has children
150- if (isset ($ resultMap [$ result ->id ])) {
150+ if (isset ($ resultMap [$ result ->getKey () ])) {
151151 $ children = collect ();
152152 // Recursively build child nodes
153- foreach ($ resultMap [$ result ->id ] as $ child ) {
153+ foreach ($ resultMap [$ result ->getKey () ] as $ child ) {
154154 $ childNode = $ this ->buildNode ($ child , $ resultMap );
155155 $ children ->push ($ childNode );
156156 }
You can’t perform that action at this time.
0 commit comments