@php $children_count = $category->children()->count(); $icon = ($children_count >= 1)? 'folder' : 'paper'; @endphp
  • {{ $category->name }} @if (count($category->children)) @endif