Closed malutanpetronel closed 7 years ago
Hi
I start using this repo in a project and noticed that getNestedList is not returning correctly the nodes as it should.
Tried with $departments = \App\Models\Department::getNestedList('name');
a child of a node is placed not immeditelly after parent as it should.
It seems the broking part is inside
return array_combine(array_map(function($node) use($key) { return $node[$key]; }, $nodes), array_map(function($node) use($seperator, $depthColumn, $column) { return str_repeat($seperator, $node[$depthColumn]) . $node[$column]; }, $nodes));
because if I use return nodes just before that part all is fine
sorry I was confused ! code is working great
Hi
I start using this repo in a project and noticed that getNestedList is not returning correctly the nodes as it should.
Tried with $departments = \App\Models\Department::getNestedList('name');
a child of a node is placed not immeditelly after parent as it should.
It seems the broking part is inside
because if I use return nodes just before that part all is fine