Welcome Guest, Not a member yet? Register   Sign In
Error cloning Entities
#1

Maybe i found a bug or maybe i made mistake. When i try to clone an entities model dont save unless i fill attributes manually BUT if i make d() i see attributes filled correctly. This is the code:
PHP Code:
$UserModel model(UserModel::class);

$oldEntry $UserModel->first();

$newEntry = clone $oldEntry;

$newEntry->idnull;

//name is required and filled in old entry
//unless this it will get an error "name required"
 $newEntry->name 'ciccio';

$UserModel->insert($newEntry); 
Any Ideas ?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB