Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function recursive($parent, $children) {
- foreach ($children as $child) {
- if ($parent->id == $child->parent->id) {
- echo 'child: ' . $child->name . ' parent:' . $child->parent->name . '<br>';
- recursive($child, $child->children()->get());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement