laravel 5 eloquent get last inserted id code example
Example 1: laravel db insert get last id
$id = DB::table('users')
->insertGetId(
['name' => 'Akash Savani', 'email'=>'[email protected]']
);
Example 2: laravel model save get id
$data->save();
$data->id;