HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/Lacom/lacom.nl/resources/views/site/partials/sitemapLoop.blade.php
@if($sitemapItem->active)

    <li>
        <a href="/{{$sitemapItem->translation->route->alias}}">{{$sitemapItem->translation->name}}</a>

        {{-- Check if sitemap item is all the end of the tree branch --}}
        @if($sitemapItem->rgt != $sitemapItem->lft+1)

            @php
                $childPages = new \Illuminate\Database\Eloquent\Collection($sitemapItem->findChildren());
                $childPages = $childPages->load('translation', 'translation.route');
            @endphp

            {{--Check if the sitemap item has children --}}
            @if(sizeof($childPages) != 0)

                {{--If it does, recall this blade with the found child as item --}}
                <ul>
                    @foreach($childPages as $child)
                        @include('site.partials.sitemapLoop', ['sitemapItem' => $child])
                    @endforeach
                </ul>
            @endif

        @endif

    </li>

@endif