/**
* Get the value of an attribute using its mutator.
*
* @param string $key
* @param mixed $value
*
* @return mixed
*/
protected function mutateAttribute($key, $value)
{
if ($this->hasField($key)) {
return $this->getFields()->get($key)->onGetDocumentValue($this, $value);
}
return parent::mutateAttribute($key, $value);
}