@foreach($subcategories as $subcategory) @if(isset($category) && $category->id == $subcategory->id) @continue; @endif @php $selected = ''; @endphp @if(isset($result) && isset($selected_categories)) @if(isset($is_multiple) && $is_multiple) @php $selected = (in_array( $subcategory->id, $selected_categories->pluck('id')->toArray())) ? 'selected' : ''; @endphp @else @if(isset($result->parent)) @php $selected = isset($result->parent) ? ($selected_categories == $subcategory->id) ? 'selected' : '' : ''; @endphp @elseif(isset($result->category)) @php $selected = isset($result->category) ? ($selected_categories == $subcategory->id) ? 'selected' : '' : ''; @endphp @endif @endif @endif @if(count($subcategory->subcategory)) @include('components._subCategoryListOption',['subcategories' => $subcategory->subcategory]) @endif @endforeach