@foreach($records as $record) {!! str_repeat(" ", $indentation * 5) !!} {{$record->name}} @if(count($record->childs)) @include('livewire/course_child',['records' => $record->childs, 'indentation' => $indentation + 1]) @endif @endforeach