how to update last inserted row in mysql using 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;