Skip to content

Commit 2baf90d

Browse files
committed
Readme updated
1 parent 464e8bd commit 2baf90d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,22 @@ Of course you will probably want a position column as well. So you will have to
4949

5050
To use it, first call the `nest()` method, followed by the `listsFlattened()` method:
5151

52-
``` php
52+
```php
5353
Model::orderBy('parent_id')->get()->nest()->listsFlattened();
5454
```
5555

5656
By default it will look for a `title` column. You can send a custom column name as first parameter:
5757

58-
``` php
58+
```php
5959
Model::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+

0 commit comments

Comments
 (0)