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

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

代码示例5
$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'));