- Support Laravel 5.8
- Support Laravel 5.7
- Support Laravel 5.6
- Added
nestedSet
anddropNestedSet
blueprint macros
- Support Laravel 5.5
- Added
fixSubtree
andrebuildSubtree
methods - Increased performance of tree rebuilding
- #217: parent_id, lft and rgt are reset when replicating a node
- #208: dirty parent and bounds when making a root
- #206: fixed where has on descendants
- refactored ancestors and descendants relations
- Fixed issues related to rebuilding tree when using
SoftDeletes
and scoping
- Added
whereAncestorOrSelf
,ancestorsAndSelf
,descendantsOrSelf
,whereDescendantOrSelf
helper methods - #186: rebuild tree removes nodes softly when model uses SoftDeletes trait
- #191: added
whereIsLeaf
andleaves
method, addedisLeaf
check on node
- #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
- #85: added tree flattening feature
- Fixed #42: model becomes dirty before save when parent is changed and using
appendTo
,prependTo
,insertBefore
,insertAfter
.
- Added
fixTree
method for fixinglft
/rgt
values based on inheritance - Dropped support of Laravel < 5.1
- Improved compatibility with different databases
- Support Laravel 5.1.9
- Renamed
append
toappendNode
,prepend
toprependNode
- Renamed
next
tonextNodes
,prev
toprevNodes
- Renamed
after
toafterNode
,before
tobeforeNode
- Added query methods
whereNotDescendantOf
,orWhereDescendantOf
,orWhereNotDescendantOf
whereAncestorOf
,whereDescendantOf
and every method that depends on them can now accept node instance- Added
Node::getBounds
that returns an array of node bounds that can be used inwhereNodeBetween
- Added
linkNodes
method toCollection
class
- Support Laravel 5
- Added
isChildOf
,isAncestorOf
,isSiblingOf
methods
- Added
insertAfter
,insertBefore
methods. prepend
andappend
methods now save target model.- You can now call
refreshNode
to make sure that node has updated structural data (lft and rgt values). - The root node is not required now. You can use
saveAsRoot
ormakeRoot
method. New model is saved as root by default. - You can now create as many nodes and in any order as you want within single request.
- Laravel 2 is supported but not required.
ancestorsOf
now doesn't include target node into results.- New constraint methods
hasParent
andhasChildren
. - New method
isDescendantOf
that checks if node is a descendant of other node. - Default order is not applied by default.
- New method
descendantsOf
that allows to get descendants by id of the node. - Added
countErrors
andisBroken
methods to check whether the tree is broken. NestedSet::createRoot
has been removed.NestedSet::column
doesn't create a foreign key anymore.
Collection::toDictionary
is now obsolete. UseCollection::groupBy
.- Laravel 4.2 is required