laravel get id of new record code example
Example 1: laravel get last id
DB::table('myTable')->orderBy('id','desc')->first();
Example 2: Get last id in laravel
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();
DB::table('myTable')->orderBy('id','desc')->first();
$last2 = DB::table('items')->orderBy('id', 'DESC')->first();