src/Support/Str.php
/**
	 * Convert a string to snake case.
	 *
	 * @param string $value
	 * @param string $delimiter
	 * @return string
	 */
Convert a string to snake case.
Convert a string to snake case .
public static function snake($value, $delimiter = '_') {
		$key = $value;
		if (isset(static::$snakeCache[$key][$delimiter])) {
			return static::$snakeCache[$key][$delimiter];
		}
		if (!ctype_lower($value)) {
			$value = preg_replace('/\s+/u', '', $value);
			$value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
		}
		return static::$snakeCache[$key][$delimiter] = $value;
	}
public static function snake ( $ value , $ delimiter = '_' ) { $ key = $ value ; if ( isset ( static :: $ snakeCache [ $ key ] [ $ delimiter ] ) ) { return static :: $ snakeCache [ $ key ] [ $ delimiter ] ; } if ( ! ctype_lower ( $ value ) ) { $ value = preg_replace ( '/\s+/u' , '' , $ value ) ; $ value = static :: lower ( preg_replace ( '/(.)(?=[A-Z])/u' , '$1' . $ delimiter , $ value ) ) ; } return static :: $ snakeCache [ $ key ] [ $ delimiter ] = $ value ; }
Convert a string to snake case.
Convert a string to snake case .