使用 bootstrap 和 onEachSide 在 Laravel 中的分页中添加链接

adding links within pagination in Laravel using bootstrap and onEachSide

这是我的问题我正在将现有的内部应用程序迁移到 Laravel,我正在处理的页面列出了客户,我正在使用 bootstrap 呈现分页部分并使用{{ $clients->onEachSide(5)->links }} 我现在想做的是在分页左侧添加一些按钮来过滤 table,但我什至不知道如何开始。上面代码渲染后的代码如下:

<nav>
    <ul class="pagination">
        <li class="page-item disabled" aria-disabled="true" aria-label="« Previous"><span class="page-link" aria-hidden="true">‹</span></li>
        <li class="page-item active" aria-current="page"><span class="page-link">1</span></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=2">2</a></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=3">3</a></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=4">4</a></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=5">5</a></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=6">6</a></li>
        <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=2" rel="next" aria-label="Next »">›</a></li>
    </ul>
</nav>

所以我想我想做的是在 ul 之后但在 nav 内添加一些内容。这可能吗?如果不是应该怎么做?

谢谢

克雷格

打开您的分页文件,然后将 class 添加到导航标签

<nav class="row">

像这样:

            <nav class="row">
                <ul class="pagination">
                    <li class="page-item disabled" aria-disabled="true" aria-label="« Previous"><span class="page-link" aria-hidden="true">‹</span></li>
                    <li class="page-item active" aria-current="page"><span class="page-link">1</span></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=2">2</a></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=3">3</a></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=4">4</a></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=5">5</a></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=6">6</a></li>
                    <li class="page-item"><a class="page-link" href="http://site.ecl/index.php/accounts?page=2" rel="next" aria-label="Next »">›</a></li>
                </ul>
                <ul class="pagination">
                    <li class="page-item"><a class="btn btn-primary" href="#">EXAMPLE</a></li>
                </ul>
            </nav>