October\Rain\Support\Str
Overview
Str helper
Extends
- Illuminate\Support\Str
Protected Properties
There are no protected properties in the class.
Show inherited protected properties
Inherited Protected Properties
- $snakeCache - The cache of snake-cased words. (defined in Illuminate\Support\Str)
- $camelCache - The cache of camel-cased words. (defined in Illuminate\Support\Str)
- $studlyCache - The cache of studly-cased words. (defined in Illuminate\Support\Str)
- $uuidFactory - The callback that should be used to generate UUIDs. (defined in Illuminate\Support\Str)
- $ulidFactory - The callback that should be used to generate ULIDs. (defined in Illuminate\Support\Str)
- $randomStringFactory - The callback that should be used to generate random strings. (defined in Illuminate\Support\Str)
- $macros - The registered string macros. (defined in Illuminate\Support\Str)
Public Methods
public static ascii()
public static ascii(string $value, string $language = 'en'): string
ascii applies transliterate when the language is not found
public static getClassId()
public static getClassId($name): void
getClassId generates a class ID from either an object or a string of the class name
public static getClassNamespace()
public static getClassNamespace($name): void
getClassNamespace returns a class namespace
public static getPrecedingSymbols()
public static getPrecedingSymbols($string, $symbol): int
getPrecedingSymbols checks if $string begins with any number of consecutive symbols, returns the number, otherwise returns 0
public static limitMiddle()
public static limitMiddle(
string $value,
int $limit = 100,
string $marker = '...'
): string
limitMiddle limits the length of a string by removing characters from the middle
public static normalizeClassName()
public static normalizeClassName($name): void
normalizeClassName removes the starting slash from a class namespace \
public static normalizeEol()
public static normalizeEol($string): void
normalizeEol converts line breaks to a standard \r\n pattern
public static ordinal()
public static ordinal(integer $number): string
ordinal converts number to its ordinal English form
This method converts 13 to 13th, 2 to 2nd ...
public static shortNumber()
public static shortNumber($number, $precision = 1): string
shortNumber converts a large number to its abbreviated form. This method converts 1000 to 1K, 1500000 to 1.5M, etc.
public static slug()
public static slug(
string $title,
string $separator = '-',
string|null $language = 'en',
array<string, $dictionary = [ '@' => 'at']
): string
slug adds extra sugar to convert slashes to separators
Inherited Public Methods
- __call() - Dynamically handle calls to the class. (defined in Illuminate\Support\Str)
- __callStatic() - Dynamically handle calls to the class. (defined in Illuminate\Support\Str)
- after() - Return the remainder of a string after the first occurrence of a given value. (defined in Illuminate\Support\Str)
- afterLast() - Return the remainder of a string after the last occurrence of a given value. (defined in Illuminate\Support\Str)
- apa() - Convert the given string to APA-style title case. (defined in Illuminate\Support\Str)
- before() - Get the portion of a string before the first occurrence of a given value. (defined in Illuminate\Support\Str)
- beforeLast() - Get the portion of a string before the last occurrence of a given value. (defined in Illuminate\Support\Str)
- between() - Get the portion of a string between two given values. (defined in Illuminate\Support\Str)
- betweenFirst() - Get the smallest possible portion of a string between two given values. (defined in Illuminate\Support\Str)
- camel() - Convert a value to camel case. (defined in Illuminate\Support\Str)
- charAt() - Get the character at the specified index. (defined in Illuminate\Support\Str)
- chopEnd() - Remove the given string(s) if it exists at the end of the haystack. (defined in Illuminate\Support\Str)
- chopStart() - Remove the given string(s) if it exists at the start of the haystack. (defined in Illuminate\Support\Str)
- contains() - Determine if a given string contains a given substring. (defined in Illuminate\Support\Str)
- containsAll() - Determine if a given string contains all array values. (defined in Illuminate\Support\Str)
- convertCase() - Convert the case of a string. (defined in Illuminate\Support\Str)
- counted() - Get the plural form of an English word with the count prepended. (defined in Illuminate\Support\Str)
- createRandomStringsNormally() - Indicate that random strings should be created normally and not using a custom factory. (defined in Illuminate\Support\Str)
- createRandomStringsUsing() - Set the callable that will be used to generate random strings. (defined in Illuminate\Support\Str)
- createRandomStringsUsingSequence() - Set the sequence that will be used to generate random strings. (defined in Illuminate\Support\Str)
- createUlidsNormally() - Indicate that ULIDs should be created normally and not using a custom factory. (defined in Illuminate\Support\Str)
- createUlidsUsing() - Set the callable that will be used to generate ULIDs. (defined in Illuminate\Support\Str)
- createUlidsUsingSequence() - Set the sequence that will be used to generate ULIDs. (defined in Illuminate\Support\Str)
- createUuidsNormally() - Indicate that UUIDs should be created normally and not using a custom factory. (defined in Illuminate\Support\Str)
- createUuidsUsing() - Set the callable that will be used to generate UUIDs. (defined in Illuminate\Support\Str)
- createUuidsUsingSequence() - Set the sequence that will be used to generate UUIDs. (defined in Illuminate\Support\Str)
- deduplicate() - Replace consecutive instances of a given character with a single character in the given string. (defined in Illuminate\Support\Str)
- doesntContain() - Determine if a given string doesn't contain a given substring. (defined in Illuminate\Support\Str)
- doesntEndWith() - Determine if a given string doesn't end with a given substring. (defined in Illuminate\Support\Str)
- doesntStartWith() - Determine if a given string doesn't start with a given substring. (defined in Illuminate\Support\Str)
- endsWith() - Determine if a given string ends with a given substring. (defined in Illuminate\Support\Str)
- excerpt() - Extracts an excerpt from text that matches the first instance of a phrase. (defined in Illuminate\Support\Str)
- finish() - Cap a string with a single instance of a given value. (defined in Illuminate\Support\Str)
- flushCache() - Remove all strings from the casing caches. (defined in Illuminate\Support\Str)
- flushMacros() - Flush the existing macros. (defined in Illuminate\Support\Str)
- freezeUlids() - Always return the same ULID when generating new ULIDs. (defined in Illuminate\Support\Str)
- freezeUuids() - Always return the same UUID when generating new UUIDs. (defined in Illuminate\Support\Str)
- fromBase64() - Decode the given Base64 encoded string. (defined in Illuminate\Support\Str)
- hasMacro() - Checks if macro is registered. (defined in Illuminate\Support\Str)
- headline() - Convert the given string to proper case for each word. (defined in Illuminate\Support\Str)
- initials() - Get the "initials" representing each word in the provided string, optionally capitalizing. (defined in Illuminate\Support\Str)
- inlineMarkdown() - Converts inline Markdown into HTML. (defined in Illuminate\Support\Str)
- is() - Determine if a given string matches a given pattern. (defined in Illuminate\Support\Str)
- isAscii() - Determine if a given string is 7 bit ASCII. (defined in Illuminate\Support\Str)
- isJson() - Determine if a given value is valid JSON. (defined in Illuminate\Support\Str)
- isMatch() - Determine if a given string matches a given pattern. (defined in Illuminate\Support\Str)
- isUlid() - Determine if a given value is a valid ULID. (defined in Illuminate\Support\Str)
- isUrl() - Determine if a given value is a valid URL. (defined in Illuminate\Support\Str)
- isUuid() - Determine if a given value is a valid UUID. (defined in Illuminate\Support\Str)
- kebab() - Convert a string to kebab case. (defined in Illuminate\Support\Str)
- lcfirst() - Make a string's first character lowercase. (defined in Illuminate\Support\Str)
- length() - Return the length of the given string. (defined in Illuminate\Support\Str)
- limit() - Limit the number of characters in a string. (defined in Illuminate\Support\Str)
- lower() - Convert the given string to lower-case. (defined in Illuminate\Support\Str)
- ltrim() - Remove all whitespace from the beginning of a string. (defined in Illuminate\Support\Str)
- macro() - Register a custom macro. (defined in Illuminate\Support\Str)
- markdown() - Converts GitHub flavored Markdown into HTML. (defined in Illuminate\Support\Str)
- mask() - Masks a portion of a string with a repeated character. (defined in Illuminate\Support\Str)
- match() - Get the string matching the given pattern. (defined in Illuminate\Support\Str)
- matchAll() - Get the string matching the given pattern. (defined in Illuminate\Support\Str)
- mixin() - Mix another object into the class. (defined in Illuminate\Support\Str)
- numbers() - Remove all non-numeric characters from a string. (defined in Illuminate\Support\Str)
- of() - Get a new stringable object from the given string. (defined in Illuminate\Support\Str)
- orderedUuid() - Generate a time-ordered UUID. (defined in Illuminate\Support\Str)
- padBoth() - Pad both sides of a string with another. (defined in Illuminate\Support\Str)
- padLeft() - Pad the left side of a string with another. (defined in Illuminate\Support\Str)
- padRight() - Pad the right side of a string with another. (defined in Illuminate\Support\Str)
- parseCallback() - Parse a Class[@]method style callback into class and method. (defined in Illuminate\Support\Str)
- pascal() - Convert a value to Pascal case. (defined in Illuminate\Support\Str)
- password() - Generate a random, secure password. (defined in Illuminate\Support\Str)
- plural() - Get the plural form of an English word. (defined in Illuminate\Support\Str)
- pluralPascal() - Pluralize the last word of an English, Pascal caps case string. (defined in Illuminate\Support\Str)
- pluralStudly() - Pluralize the last word of an English, studly caps case string. (defined in Illuminate\Support\Str)
- position() - Find the multi-byte safe position of the first occurrence of a given substring in a string. (defined in Illuminate\Support\Str)
- random() - Generate a more truly "random" alpha-numeric string. (defined in Illuminate\Support\Str)
- remove() - Remove any occurrence of the given string in the subject. (defined in Illuminate\Support\Str)
- repeat() - Repeat the given string. (defined in Illuminate\Support\Str)
- replace() - Replace the given value in the given string. (defined in Illuminate\Support\Str)
- replaceArray() - Replace a given value in the string sequentially with an array. (defined in Illuminate\Support\Str)
- replaceEnd() - Replace the last occurrence of a given value if it appears at the end of the string. (defined in Illuminate\Support\Str)
- replaceFirst() - Replace the first occurrence of a given value in the string. (defined in Illuminate\Support\Str)
- replaceLast() - Replace the last occurrence of a given value in the string. (defined in Illuminate\Support\Str)
- replaceMatches() - Replace the patterns matching the given regular expression. (defined in Illuminate\Support\Str)
- replaceStart() - Replace the first occurrence of the given value if it appears at the start of the string. (defined in Illuminate\Support\Str)
- resetFactoryState() - Return all factory functions to their default state. (defined in Illuminate\Support\Str)
- reverse() - Reverse the given string. (defined in Illuminate\Support\Str)
- rtrim() - Remove all whitespace from the end of a string. (defined in Illuminate\Support\Str)
- singular() - Get the singular form of an English word. (defined in Illuminate\Support\Str)
- snake() - Convert a string to snake case. (defined in Illuminate\Support\Str)
- squish() - Remove all "extra" blank space from the given string. (defined in Illuminate\Support\Str)
- start() - Begin a string with a single instance of a given value. (defined in Illuminate\Support\Str)
- startsWith() - Determine if a given string starts with a given substring. (defined in Illuminate\Support\Str)
- studly() - Convert a value to studly caps case. (defined in Illuminate\Support\Str)
- substr() - Returns the portion of the string specified by the start and length parameters. (defined in Illuminate\Support\Str)
- substrCount() - Returns the number of substring occurrences. (defined in Illuminate\Support\Str)
- substrReplace() - Replace text within a portion of a string. (defined in Illuminate\Support\Str)
- swap() - Swap multiple keywords in a string with other keywords. (defined in Illuminate\Support\Str)
- take() - Take the first or last {$limit} characters of a string. (defined in Illuminate\Support\Str)
- title() - Convert the given string to proper case. (defined in Illuminate\Support\Str)
- toBase64() - Convert the given string to Base64 encoding. (defined in Illuminate\Support\Str)
- trans() - Translate the given message and get a new stringable object. (defined in Illuminate\Support\Str)
- transliterate() - Transliterate a string to its closest ASCII representation. (defined in Illuminate\Support\Str)
- trim() - Remove all whitespace from both ends of a string. (defined in Illuminate\Support\Str)
- ucfirst() - Make a string's first character uppercase. (defined in Illuminate\Support\Str)
- ucsplit() - Split a string into pieces by uppercase characters. (defined in Illuminate\Support\Str)
- ucwords() - Capitalize the first character of each word in a string. (defined in Illuminate\Support\Str)
- ulid() - Generate a ULID. (defined in Illuminate\Support\Str)
- unwrap() - Unwrap the string with the given strings. (defined in Illuminate\Support\Str)
- upper() - Convert the given string to upper-case. (defined in Illuminate\Support\Str)
- uuid() - Generate a UUID (version 4). (defined in Illuminate\Support\Str)
- uuid7() - Generate a UUID (version 7). (defined in Illuminate\Support\Str)
- wordCount() - Get the number of words a string contains. (defined in Illuminate\Support\Str)
- wordWrap() - Wrap a string to a given number of characters. (defined in Illuminate\Support\Str)
- words() - Limit the number of words in a string. (defined in Illuminate\Support\Str)
- wrap() - Wrap the string with the given strings. (defined in Illuminate\Support\Str)
Protected Methods
Show inherited protected methods
Inherited Protected Methods
- replaceWhileIgnoringCase() - Replace the given value in the given string regardless of case. (defined in Illuminate\Support\Str)