laravel after insert get id 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;