return last inserted id in laravel

Solutions on MaxInterview for return last inserted id in laravel by the best coders in the world

showing results for - "return last inserted id in laravel"
Éloïse
13 Aug 2019
1$id = DB::table('users')->insertGetId([
2    'email' => 'john@example.com',
3    'votes' => 0
4]);
5
Leena
28 Apr 2017
1DB::getPdo()->lastInsertId();
2