show last inserted row selected in table using laravel code example
Example 1: return last inserted id in laravel
$id = DB::table('users')->insertGetId([
'email' => '[email protected]',
'votes' => 0
]);
Example 2: return last inserted id in laravel
DB::getPdo()->lastInsertId();