File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,22 @@ Of course you will probably want a position column as well. So you will have to
4949
5050To use it, first call the ` nest() ` method, followed by the ` listsFlattened() ` method:
5151
52- ``` php
52+ ``` php
5353Model::orderBy('parent_id')->get()->nest()->listsFlattened();
5454```
5555
5656By default it will look for a ` title ` column. You can send a custom column name as first parameter:
5757
58- ``` php
58+ ``` php
5959Model::orderBy('parent_id')->get()->nest()->listsFlattened('name');
6060```
61+
62+ ## Nesting a subtree
63+
64+ This package remove items that have missing ancestor, this doesn’t allow you to nest a branch of a tree.
65+ To avoid this, you can use the ``` noCleaning() ``` method:
66+
67+ ``` php
68+ Model::orderBy('parent_id')->get()->noCleaning()->nest();
69+ ```
70+
You can’t perform that action at this time.
0 commit comments