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