In Laravel 6, query the implementation of the last 2nd record
1. In Laravel 6, you need to query the penultimate record. as shown in Figure 1
2. Based on the reverse order, use LIMIT, the code is implemented as follows
$themeSaasTask = ThemeSaasTask::orderByDesc('id')->limit(2)->get();
print_r($themeSaasTask->last());
exit;
3. The printing results are in line with expectations. as shown in Figure 2

