get last id in laravel using order by 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();