在 Laravel 6 中,查询出倒数第 2 条记录的实现 由 永夜 · 2023/10/11 浏览量: 25 1、在 Laravel 6 中,需要查询出倒数第 2 条记录。如图1图12、基于倒序排列,使用 limit,代码实现如下 $themeSaasTask = ThemeSaasTask::orderByDesc('id')->limit(2)->get(); print_r($themeSaasTask->last()); exit; 3、打印结果符合预期。如图2图2 Share
0 在 Laravel 6、Lighthouse 中,报错:Argument 1 passed to Nuwave\Lighthouse\Schema\TypeRegistry::get() must be of the type string, array given 2022/05/07