
Hard to describe this in the title so this image might clarify: I have a recursive view which outputs the above: @foreach($pages as $page) <option value="{{$page->id}}" @if($selected == $page->id) selected @endif >@for($i=0; $i<$levels; $i++)↪@endfor {{$page->title}} (#{{$page->id}}) </option> @if($page->children->count()) @include(‘cms::admin.partials.page-selector-option’, [‘pages’ => $page->children, ‘levels’ => $levels + 1]) @endif @endforeach Let’s say that a page has ..