Is there a way to get the last_insert_id
when using laravel's raw query?
DB::query('INSERT into table VALUES ('stuff') ')
This returns true or false. Is there a way to get last_insert_id using raw queries in Laravel?
Just the benefit of those who might have be having the same question for laravel 4, there is a slight syntax change from @haso-keric's response.
It is:
$id = DB::table('users')->insertGetId(array('email' => '[email protected]')