Dapatkan ID Terakhir di Laravel
$last3 = DB::table('items')->latest('id')->first();
Awful Albatross
$last3 = DB::table('items')->latest('id')->first();
$last = DB::table('items')->latest()->first();
DB::getPdo()->lastInsertId();
$id = DB::table('users')->insertGetId([
'email' => '[email protected]',
'votes' => 0
]);
DB::table('myTable')->orderBy('id','desc')->first();
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();