I'm using Lumen 5.1 and running raw SQL queries, using the DB
facade.
How can I get the row's id after performed an insert
query?
For example:
$rowId = DB::insert("insert into `customers` (name) values ('Tom')");
echo $rowId; // 1
The variable $rowId
should then contains the db row's id.