@php
    $submenu = count($menu['children'] ?? []) ? App\Repositories\Core\Arrays::slotify($menu['children'], 6) : [];
@endphp

<div class="container p-0">
    <div class="row m-0 shadow bg-white p-2 w-100 @if (in_array($menu['id'], [$category['id'] ?? false, $category['parent_id'] ?? false])) active @endif">
        <div class="col mb-4">
            <a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $menu['id']]) }}">
                <div class="w-100"><strong>Tous les articles</strong></div>
            </a>
            @for ($i = 0; $i < count($submenu[0]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[0][$i]])
            @endfor
        </div>
        <div class="col mb-4">
            @for ($i = 0; $i < count($submenu[1]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[1][$i]])
            @endfor
        </div>
        <div class="col mb-4">
            @for ($i = 0; $i < count($submenu[2]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[2][$i]])
            @endfor
        </div>
        <div class="col mb-4">
            @for ($i = 0; $i < count($submenu[3]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[3][$i]])
            @endfor
        </div>
        <div class="col mb-4">
            @for ($i = 0; $i < count($submenu[4]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[4][$i]])
            @endfor
        </div>
        <div class="col mb-4">
            @for ($i = 0; $i < count($submenu[5]); $i++)
                @include('Shop.layout.partials.megamenu_leafs', ['menu_children' => $submenu[5][$i]])
            @endfor
        </div>
    </div>
</div>
