Hi,
Is to possible to make unlimited tree with the Pivot component for the id / parent Id data? May be there is a way to build that tree
programmatically?
For example we have “fruits” table.
id | parentId | Name | Quantity |
1 | null | Fruits | null |
2 | 1 | Small | null |
3 | 2 | Apple | 5 |
4 | 2 | Banana | 2 |
5 | 1 | Big | null |
6 | 5 | Melon| 3 |
…
Than it would be great to have a tree, like:
Fruits = 10
–Small = 7
----Apple = 5
----Banana = 2
–Big = 3
----Melon= 3
Thank you.