Blame view

resources/views/part/categories.blade.php 648 Bytes
295e31db7   Андрей Ларионов   Флаги производите...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  @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="{{$item->id}}">{{ $item->name }}</a></li>
          @else
          </ul>
              <button class="catalog-accordion js_catalog_accordion">{{$item->name}}</button>
              <ul class="catalog-accordion-panel">
          @endif
          <? /*if($item == end($array)) {?>
              </ul>
              <? $level = -1;
              }*/?>
  
          @include('part.categories', ['level' => $level, 'parent' => $item->id])
  
  
      @endforeach
  
  @endif