laravel db insert get last id
snippet in php

laravel db insert get last id

user2842

$id = DB::table('users')

  ->insertGetId(

	  ['name' => 'Akash Savani', 'email'=>'akash@gmail.com']

);