In Laravel 4, when you perform a DB::insert(), how can you get the ID of the row that has just been inserted? Similar what we have with the function ->
DB::insert()
->
A bit late with the answer but, I think for psql it's best to use native RETURNING id
RETURNING id
The query that worked for me was:
DB::select( DB::raw('insert into threads (created_at, updated_at) values (?, ?) returning id'), [Carbon::now(), Carbon::now()] );