laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

$model->replicate() fails because of row number

Open nmalcolm opened this issue 2 years ago • 1 comments

Summary of problem or feature request

Replicating and saving a new model fails as it tries to insert into the rn column which doesn't exist.

Code snippet of problem

$model = Model::find(1);
$newRecord = $model->replicate();
$newRecord->setTable('whatever');
$newRecord->save();

This can be worked around by using replicate(['rn']) which excludes it.

System details

  • Ubuntu 22.04
  • PHP 8.1
  • Laravel 10
  • Laravel-OCI8 10.3

nmalcolm avatar Mar 06 '23 11:03 nmalcolm