how to get new inserted id in laravel code example
Example 1: laravel get last id
DB::table('myTable')->orderBy('id','desc')->first();
Example 2: laravel model save get id
$data->save();
$data->id;
DB::table('myTable')->orderBy('id','desc')->first();
$data->save();
$data->id;