how to get last inserted id same id in laravel query builder code example
Example 1: Get last id in laravel
$last3 = DB::table('items')->latest('id')->first();
Example 2: laravel db insert get last id
$id = DB::table('users')
->insertGetId(
['name' => 'Akash Savani', 'email'=>'[email protected]']
);