In my database I have
|path|id|
The path is something like
"Brand1/Cabinet/T18"
"Brand1/Cabinet/E12"
"Brand1/Cabinet"
"Brand1"
"Brand1/Uix"
"Brand2/Uix"
"Brand2/Asset/download"
How I can split the path so the json will looks like a tree structure with root and child nodes?
I think I have to split the path with "/". Then create an array with the nodes. Is there a better an faster way to bring a structure like this into json nodes?