/**
* Override to make sure timestamp fields are mutated correctly
*
* @inheritdoc
*/
protected function mutateAttributeForArray($key, $value)
{
// for timestamps, do NOT pass through the mutator, or
// we'll end up with Carbon instances
if (static::CREATED_AT === $key || static::UPDATED_AT === $key || in_array($key, $this->nonTimestampDates)) {
return $value;
}
return parent::mutateAttributeForArray($key, $value);
}