laravel query builder get last insert id
snippet in php

laravel query builder get last insert id

user4613

$id = DB::table('users')->insertGetId(
    ['email' => 'john@example.com', 'votes' => 0]
);