@php function renderOptions($group, $indent = 0) { echo ''; if ($group->children->isNotEmpty()) { foreach ($group->children as $child) { renderOptions($child, $indent + 1); } } } @endphp