Here is my code
$users = DB::table('users')->insert(array(
'email_id' => $email_id,
'name' => $name,
));
$lastInsertedID = $users->lastInsertId();
return $lastInsertedID;
I want to get the last inserted id for a specific record. I tried using Eloquent ORM. but it didn’t work.
Any help would be greatly appreciated.
Thank.
source
share