etrepat / baum

Baum is an implementation of the Nested Set pattern for Laravel's Eloquent ORM.
http://etrepat.com/baum
MIT License
2.24k stars 459 forks source link

Project died ? #274

Closed malutanpetronel closed 7 years ago

malutanpetronel commented 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

malutanpetronel commented 7 years ago

sorry I was confused ! code is working great