Releases: lazychaser/laravel-nestedset
v4.1.0
New features
Converted to trait
Nested set features are now enabled using a trait and overrides as less methods as possible. For smooth transition, Node
class is still available but is now deprecated and will be removed in the next significant release. Also, some methods were renamed (see changelog).
Scoping
You can now store multiple trees in the same table by filtering using model attributes. Read more.
Rebuilding a tree
In this release, tree rebuilding feature is added. You can completely rebuild a tree from an array. This can be used when you editing your tree on the client side and then sending full tree to the server. Algorithm updates nodes based on primary key, creates new ones and can delete nodes that are not on array. More info.
Descendants as a relation
Nodes now have descendants
relation which can be eagerly loaded. This is helpful when you have a large tree and need to load few subtrees:
$nodes = Category::with('descendants')->whereIn('id', $idList)->get();
Other
hasParent
and hasChildren
is now deprecated in favor of default laravel functionality has('parent')
and has('children')
.
Default order is no longer applied for siblings()
, descendants()
, prevNodes()
, nextNodes()
.
Other small features and bug fixes. See changelog.
v4.1.0-beta
- #75: Converted to trait. Following methods were renamed:
appendTo
toappendToNode
prependTo
toprependToNode
insertBefore
toinsertBeforeNode
insertAfter
toinsertAfterNode
getNext
togetNextNode
getPrev
togetPrevNode
- #82: Fixing tree now handles case when nodes pointing to non-existing parent
- The number of missing parent is now returned when using
countErrors
- #79: implemented scoping feature
- #81: moving node now makes model dirty before saving it
- #45: descendants is now a relation that can be eagerly loaded
hasChildren
andhasParent
are now deprecated. Usehas('children')
has('parent')
instead- Default order is no longer applied for
siblings()
,descendants()
,
prevNodes
,nextNodes
- #50: implemented tree rebuilding feature
v2.0-beta2
Add donate button
v2.0-beta
Fix incompatibilities
Migrate to Laravel 4.2
v1.1 Merge branch '1.1'