baum
baum copied to clipboard
makeChildOf() function repeats indexes and returns broken tree
Hi Im new with baum but I have a very simple problem.
I had a new tree (made with rebuild function) so I can check it with isValidNestedSet() function and returns true.
Now, I want to add a new category to the tree. So I create it. $c = new Category($request->all()); $c->save(); if ($request->parent_id == 0) { $c->makeRoot(); } else { $c->makeChildOf($request->parent_id); }
The tree now is showing in perfect condition on screen but it isnt the same on DB. the new record has repeated his left and right indexes from others records. and if I now test the tree with isValidNestedSet() it returns false;
Why? What Im doing wrong ?
Thanks in advance.
same issue..