laravel 5.7 get insert id after insert code example
Example 1: Get last id in laravel
$last3 = DB::table('items')->latest('id')->first();
Example 2: laravel get ID from insert
$data = User::create(['name'=>'first']);
dd($data->id);
$last3 = DB::table('items')->latest('id')->first();
$data = User::create(['name'=>'first']);
dd($data->id);