code: protected function getMutator($value, $dir = 'setter', $type = null)
      {
          $type = $type ?: $this->getValueType($value);
  
          foreach ($this->{"{$dir}Mutators"} as $mutated => $mutator) {
              if ($type == $mutated || $value instanceof $mutated) {
                  return $mutator;
              }
          }
      }
docs: Get mutator for the type.
  
  @param  mixed  $value
  @param  string $dir
  @return string