<div>
<?php
                    $grouped = sidebar_categories()->groupBy(fn($cat) => $cat->parent_category->name ?? 'Others');
                    ?>

                    <div class="categories-widget widget-item">
                        <h3 class="widget-title">Categories</h3>

                        <?php $__currentLoopData = $grouped; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $parentName => $categories): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <h6 class="mt-3"><strong><?php echo e($parentName); ?></strong></h6>
                        <ul class="ms-3">
                            <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li>
                                <a href="<?php echo e(route('category_post', $item->slug)); ?>">
                                    <?php echo e($item->name); ?> <span>(<?php echo e($item->posts_count); ?>)</span>
                                </a>
                            </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </ul>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
</div><?php /**PATH C:\xampp\htdocs\larablog\resources\views\components\sidebar-categories.blade.php ENDPATH**/ ?>