return some of the last inserted record in laravel query builder code example
Example 1: Get last id in laravel
$last3 = DB::table('items')->latest('id')->first();
Example 2: Get last id in laravel
$last = DB::table('items')->latest()->first();
$last3 = DB::table('items')->latest('id')->first();
$last = DB::table('items')->latest()->first();