@foreach ($childs as $child) @if ($parent_id == $child->id) {{ str_pad('', $level, '-') . ' ' . $child->name }} @else {{ str_pad('', $level, '-') . ' ' . $child->name }} @endif @if (count($child->childs)) @include('auks.optionChildSelected', [ 'childs' => $child->childs, 'parent_id' => $auk->parent_id, 'level' => $level + 1, ]) @endif @endforeach