We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5b5d08 commit 977f0efCopy full SHA for 977f0ef
README.md
@@ -29,3 +29,16 @@ Model::orderBy('parent_id')->get()->nest();
29
```
30
31
Of course you will probably want a position column as well. So you will have to order first by parent_id asc and then by position asc.
32
+
33
+## Indented and flattened list
34
35
+```listsFlattened()``` method generate the tree as a flattened list with id as keys and title as values, perfect for select/option, for example :
36
37
+```php
38
+[
39
+ '22' => 'Item 1 Title',
40
+ '10' => ' Child 1 Title',
41
+ '17' => ' Child 2 Title',
42
+ '14' => 'Item 2 Title',
43
+]
44
+```
0 commit comments