andyandy's avatar

How to reinsert a record into a table?

I want each of selected records reinsert into table as a new row (so they get highest ID + current created_at) and delete old row.

$records = Record::where('board_id', 2)->......blah blah......->get();

        foreach ($records as $record) {
           
	$newRecord = New Record();
	//???
            
        }

0 likes
2 replies

Please or to participate in this conversation.