在仪表板上打印最后5篇文章

问题描述 投票:0回答:1

我想知道如何使用背包在仪表板上放置最后5个项目的清单?我做了桌子

<div class="table-responsive">
    <table class="table table-hover m-0 table-actions-bar">

        <thead>
        <tr>
            <th>
                <div class="btn-group dropdown">
                    <button type="button" class="btn btn-light btn-xs dropdown-toggle waves-effect waves-light"
                            data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-chevron-down"></i></button>
                    <div class="dropdown-menu">
                        <a class="dropdown-item" href="#">Dropdown link</a>
                        <a class="dropdown-item" href="#">Dropdown link</a>
                    </div>
                </div>
            </th>
            <th>Titolo Post</th>
            <th>Data</th>
            <th>Stato</th>
            <th>Categria</th>
            <th>Azione</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>

            </td>

            <td>
                <h5 class="m-0 font-weight-medium"></h5>
            </td>

            <td>
                <i class="mdi mdi-map-marker text-primary"></i>
            </td>

            <td>
                <i class="mdi mdi-clock-outline text-success"></i>
            </td>

            <td>
                <i class="mdi mdi-currency-usd text-warning"></i>
            </td>

            <td>
                <a href="#" class="table-action-btn"><i class="mdi mdi-pencil"></i></a>
                <a href="#" class="table-action-btn"><i class="mdi mdi-close"></i></a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

我在jumbotron.blade.php中制作了表格,然后将显示在屏幕上的最后5个帖子显示在屏幕上的功能?在仪表板方法中?

$recentPost : Article::orderBy('id', 'desc')>limit(5)->get()

还有其他解决方案吗?

laravel backpack-for-laravel
1个回答
1
投票
此行将为您提供最后5篇文章。
© www.soinside.com 2019 - 2024. All rights reserved.