mercredi 5 septembre 2018

laravel replicate() method and computed database column

I'm trying to copy a row using by replicate() method:

$doc = Doc::find(64618);
$newdoc = $doc->replicate();
$newdoc->Price= 9999; 
$newdoc->save();

but this table contains several computed columns and I get an error that the data fields can not be updated. How can I exclude these fields when using replicate()?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire