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

How do to move to child #276

Open yashiroiori opened 7 years ago

yashiroiori commented 7 years ago

Table: id parent_id lft rgt depth name 2 1 2 3 1 100.100 - 4 pulgadas inferior 358385 1 716766 716771 1 Grupo1 358386 358385 716767 716768 2 Grupo2

How do to make id 2 of child or 358386, I try with make: $grupo2 = Category::find(358386); $item = Category::find(2); $item->makeChildOf($grupo2);

Then try to use makeFirstChildOf, moveToRightOf and moveToLeftOf but nothing

I try with items are to the left of id 358386 and it's work, but the item are at beging of the same depth not work why??

Records in table are around 350,000 and I need make in warehouse to group the items by packaging for the sale where each item have product_id, sale_order_id and uuid, when items are sale I need scan UUID from ticket of packaging and need draw all parent and childs items from root to last child be found the item with UUID scanned.

I can do this with this package??