<ul> <?php $__currentLoopData = $childs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $child): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <li> <?php echo e($child->name . ' (ID: '.$child->id.')'); ?> <?php if(count($child->categories)): ?> <?php echo $__env->make('partials.manage.subcategories',['childs' => $child->categories], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?> <?php endif; ?> </li> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </ul>