techcon/nestedsets

Package for manipuate nestedsets in Laravel without Eloquent ORM

v1.0.0 2016-07-05 10:30 UTC

This package is auto-updated.

Last update: 2024-11-15 15:06:14 UTC


README

Package for manipuate nestedsets in Laravel without Eloquent ORM

How to use

  1. Create: $nestedset = Nestedsets::factory('TableName');
  2. Move:
  3. $nestedset->move('current_item_id', 'sibiling_item_id')->before(); // This move item before other element
  4. $nestedset->move('current_item_id', 'parent_item_id' or 0)->asChild(); // This move item as last element to parent
  5. Delete: $nestedset->deleteNode('item_id'); // This delete node and all childs