categories_menu.blade.php 704 Bytes
@if ($items->where('parent_id', $parent)->count())
    @php $level++ @endphp
    <? $array = $items->where('parent_id', $parent) ?>
    @foreach ($array as $item)

        @if($level)
            <li><a href="{{ route('catalog_detail', $item->id)}}">{{ $item->name }}</a></li>
        @else
        </ul>
            <button class="catalog-accordion modal-cat-acc-but js_catalog_accordion">{{$item->name}}</button>
            <ul class="catalog-accordion-panel modal-cat-panel">
        @endif
        <? /*if($item == end($array)) {?>
            </ul>
            <? $level = -1;
            }*/?>
        @include('part.categories', ['level' => $level, 'parent' => $item->id])
    @endforeach
@endif