@php $value = null; for ($i = 0; $i < $child_category->level; $i++) { $value .= '-'; } @endphp @if ($child_category->categories) @foreach ($child_category->categories as $childCategory) @include('categories.child_category_many', ['child_category' => $childCategory , 'category_id' => $category_id]) @endforeach @endif