{{-- _nested_index.blade.php --}} @if($category->children->isNotEmpty())
@if (!is_null($category->image_url)) @endif {{ $category->title }}
@foreach($category->children->sortByDesc('priority') as $child) @if (!is_null($child->image_url)) @endif {{ $child->title }} @if($child->children->isNotEmpty())
@foreach($child->children->sortByDesc('priority') as $grandchild) {{ $grandchild->title }} @endforeach
@endif @endforeach
@else
{{ $category->title }}
@endif