
<?php echo e($paginate->firstItem()); ?> - <?php echo e($paginate->lastItem()); ?> of <?php echo e($paginate->total()); ?> results

<nav aria-label="Page navigation example">
    
    <ul class="pagination">
        
        <li class="page-item">
            <a class="page-link" href="<?php echo e($paginate->url(1)); ?>">First</a>
        </li>

        
        <?php
            $totalPages = ceil($paginate->total() / $paginate->perPage());
            $currentPage = $paginate->currentPage();
            $middlePage = floor($totalPages / 2);
        ?>

        <?php if($totalPages > 3): ?>
            
            <?php for($i = max($currentPage - 2, 2); $i < $currentPage; $i++): ?>
                <li class="page-item <?php echo e($currentPage == $i ? 'active' : ''); ?>">
                    <a class="page-link" href="<?php echo e($paginate->url($i)); ?>"><?php echo e($i); ?></a>
                </li>
            <?php endfor; ?>

            
            <li class="page-item active">
                <a class="page-link" href="#"><?php echo e($currentPage); ?></a>
            </li>

            
            <?php for($i = $currentPage + 1; $i <= min($currentPage + 2, $totalPages - 1); $i++): ?>
                <li class="page-item <?php echo e($currentPage == $i ? 'active' : ''); ?>">
                    <a class="page-link" href="<?php echo e($paginate->url($i)); ?>"><?php echo e($i); ?></a>
                </li>
            <?php endfor; ?>

            
            <li class="page-item">
                <a class="page-link" href="<?php echo e($paginate->url($totalPages)); ?>">Last</a>
            </li>
        <?php else: ?>
            
            <?php for($i = 2; $i < $totalPages; $i++): ?>
                <li class="page-item <?php echo e($currentPage == $i ? 'active' : ''); ?>">
                    <a class="page-link" href="<?php echo e($paginate->url($i)); ?>"><?php echo e($i); ?></a>
                </li>
            <?php endfor; ?>
        <?php endif; ?>
        <?php if($paginate->nextPageUrl()): ?>
            <li class="page-item">
                <a class="page-link" href="<?php echo e($paginate->nextPageUrl()); ?>" aria-label="Next">
                    <span aria-hidden="true">Next</span>
                </a>
            </li>
        <?php endif; ?>
    </ul>
</nav>
<?php /**PATH /home/apleusbj/shopping.apleefix.com/resources/views/components/paginate.blade.php ENDPATH**/ ?>