Use laravel pluralization, and if that one fails give a warning and just append "s".

@param $value

@return string
773819
public static function safePlural($value)
    {
        $plural = str_plural($value);
        if ($plural == $value) {
            $plural = $value.'s';
            echo 'warning: automatic pluralization of '.$value.' failed, using '.$plural.LF;
        }

        return $plural;
    }
331723
protected function formatValue($value)
    {
        if ($this->formatValue !== NULL) {
            return str_replace(static::VALUE_IDENTIFIER, $value, $this->formatValue);
        } else {
            return $value;
        }
    }
372231
static public function gender($value=null)
    {
        if (!$value) return '保密';
        
        if (is_numeric($value)) {
            return $value == 1 ? '男' : ($value == 2 ? '女' : '保密');
        } else {
            return $value == '男' ? '男' : ($value == '女' ? '女' : '保密');
        }
    }
834399
protected function fixString($value)
    {
        if (is_numeric($value)) {
            $value = [static::ID_PREFIX, $value];
        }

        if (is_array($value)) {
            $value = implode(static::SEP_MINOR, $value);
        }

        if (in_array($value, [false, true, null], true)) {
            return strtolower(var_export($value, true));
        }

        return Str::slug($value, static::SEP_MINOR);
    }
822059
protected function valueToString($value) : string
    {
        if ($value === null) {
            $def_value = 'null';
        } elseif ($value === false) {
            $def_value = 'false';
        } elseif ($value === true) {
            $def_value = 'true';
        } elseif (is_string($value)) {
            $def_value = '"' . str_replace('"', '\\"', $value) . '"';
        } elseif (is_numeric($value)) {
            $def_value = '' . $value;
        }

        return $def_value;
    }
227251
protected static function getLocalizedDescription($value): ?string
    {
        if (static::isLocalizable())
        {
            $localizedStringKey = static::getLocalizationKey() . '.' . $value;

            if (Lang::has($localizedStringKey))
            {
                return __($localizedStringKey);
            }
        }

        return null;
    }
1179729
protected function getValueWithoutInvertedCommas($value)
    {
        if (substr($value, 0, 1) === '\'' && substr($value, -1, 1) === '\'') {
            $value = substr($value, 1, -1);
        }

        return $value;
    }
202297
public function transform($value)
    {
        if (null === $value || !($value instanceof Collection)) {
            return '';
        }

        $string = '';
        foreach ($value as $item) {
            $string .= $item->getId();

            if ($value->last() != $item) {
                $string .= ',';
            }
        }

        return $string;
    }
1087381
protected function formatValue($value): string {
        if (is_string($value) && mb_strlen($value) > 20) {
            $value = mb_substr($value, 0, 20).'…';
        }

        if (is_scalar($value)) {
            return json_encode($value);
        } else {
            return $this->translate('value');
        }
    }
857692
public function formatValues($value)
    {
        $options = $this->getOptions();
        if (is_array($value)) {
            if ($options) {
                foreach ($value as &$val) {
                    if (isset($options[$val])) {
                        $val = $options[$val];
                    }
                 }
            }
            return implode($this->_('; '), $value);
        }
        if (isset($options[$value])) {
            return $options[$value];
        }
        return $value;
    }
565391
private function addPrefixSuffix($value)
    {
        if (!is_null($this->prefix) || !is_null($this->suffix)) {
            return (string) $this->prefix . $value . (string) $this->suffix;
        }

        return $value;
    }
630664
public function escape($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

        return is_string($value) ? htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false) : $value;
    }
688868
public function serialize($value)
    {
        if ($this->getDataType() === 'json') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'array') {
            return json_encode($value);
        } elseif ($this->getDataType() === 'list') {
            return implode(',', $value);
        }

        return trim($value);
    }
434737
public static function transformForStub(string $value)
    {
        $value = Strings::toSnakeCase($value);
        return '[' . str_replace(' ', '_', strtoupper($value)) . ']';
    }
1287499
private function getEscape($value = '$value')
    {
        if ($this->customEscape) {
            return sprintf(self::CUSTOM_ESCAPE, $value);
        }

        return sprintf(self::DEFAULT_ESCAPE, $value, var_export($this->entityFlags, true), var_export($this->charset, true));
    }
402688
public static function pascalCase(string $value): string
    {
        $value = ucwords(str_replace(['-', '_'], ' ', $value));
        return str_replace(' ', '', $value);
    }
682103
protected function getPluralForm($value)
    {
        // Strip non-plural keys away
        if (is_array($value)) {
            $forms = i18n::config()->uninherited('plurals');
            $forms = array_combine($forms, $forms);
            return array_intersect_key($value, $forms);
        }

        // Parse from string
        // Note: Risky outside of 'en' locale.
        return i18n::parse_plurals($value);
    }