public static function snakeCase(string $value, bool $toLowerCase = false, string $separator = '_'): string
    {
        $replace = strtolower(preg_replace(
            ['/\s+/', '/\s/', '/(?|([a-z\d])([A-Z])|([^\^])([A-Z][a-z]))/', '/[-_]+/'],
            [' ', $separator, '$1' . $separator . '$2', $separator],
            trim($value)
        ));
        return $toLowerCase ? strtolower($replace) : $replace;
    }