How can I return a nested structure from 3 Models with one-to-many nested relations?
Example:
Models State, Region, Province
Every State
can have many Regions
and every Region
can have many Provinces
.
My relations work perfectly, but I don't know if there is a way to make one JsonArray containing every State
, and for every State
every Region
and so on going down in relations.
I hope to be clear, if you need I can post my code.