<?php if(!empty($categories)): ?>
    <ul class="nav navbar-nav navbar-right">
        <li class="dropdown right">
            <a href="#" data-toggle="dropdown" class="dropdown-toggle">
                <span class="hidden-sm">Category</span><i class="fa fa-bars ml-5"></i>
            </a>
            <ul class="dropdown-menu">
                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="dropdown-submenu"><a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"><?php echo $category->name; ?></a>
                    <ul class="dropdown-menu">
                        <?php $__currentLoopData = $subcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if($category->id == $subcategory->category_id): ?>
                                <li><a href="category.html"><?php echo $subcategory->name; ?></a></li>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </ul><!-- end ul dropdown-menu -->
        </li><!-- end dropdown -->
    </ul><!-- end navbar-right -->
<?php endif; ?>