I'm trying to copy a row from a table to another table with Laravel Query and I get the following error.
$invoice = Capsule::table('tblinvoices')->where('id', $invoiceid)->get(); //array
$copiedInvoiceid = Capsule::table('mod_myinvoices')->insertGetId(array($invoice));
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'field list' (SQL: )
I've used CREATE TABLE mod_myinvoices LIKE tblinvoices
to create mod_myinvoices
table.
Any suggestions ?