I'm trying to clone a model using the function attributesToArray; but, I've got a problem with dates created_at = '0000-00-00 00:00:00.000000'
.
This is my code:
$user2 = new User2();
$user2->fill($user->attributesToArray());
Exception returns me the message:
InvalidArgumentException Unexpected data found. Trailing data
The answer is change the model:
public function getDates()
{
return array();
}