📌  相关文章
📜  laravel 获取最后 5 条记录 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.039000             🧑  作者: Mango

代码示例3
$row = News::count();
        $newsid = $row -2;
        $news1 = News::all()->last();
        $news2 = News::orderBy('created_at', 'desc')->skip($newsid)->take($newsid)->first();
        return view('user/start', compact('news1', 'news2', 'newsid'));