@php $dash .= '--'; @endphp @foreach ($subcategories as $subcategory) @if (count($subcategory->subcategory)) @include('backend.category.sub-category-list-option-for-update', [ 'subcategories' => $subcategory->subcategory, 'selectedCategories' => $selectedCategories, 'dash' => $dash // pass updated dash for further indentation ]) @endif @endforeach