mutateAttribute() protected method

Get the value of an attribute using its mutator.
protected mutateAttribute ( string $key, mixed $value ) : mixed
$key string
$value mixed
return mixed
 /**
  * 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);
 }