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
49
49
50
50
To use it, first call the ` nest() ` method, followed by the ` listsFlattened() ` method:
51
51
52
- ``` php
52
+ ``` php
53
53
Model::orderBy('parent_id')->get()->nest()->listsFlattened();
54
54
```
55
55
56
56
By default it will look for a ` title ` column. You can send a custom column name as first parameter:
57
57
58
- ``` php
58
+ ``` php
59
59
Model::orderBy('parent_id')->get()->nest()->listsFlattened('name');
60
60
```
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