Space

February 3, 2026 ยท View on GitHub

  • Space()
  • Space(string ...$additionalChars)

Validates whether the input contains only whitespaces characters.

v::space()->assert('    ');
// Validation passes successfully

Templates

Space::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must consist only of space characters
inverted{{subject}} must not consist only of space characters

Space::TEMPLATE_EXTRA

ModeTemplate
default{{subject}} must consist only of space characters or {{additionalChars}}
inverted{{subject}} must not consist only of space characters or {{additionalChars}}

Template placeholders

PlaceholderDescription
additionalCharsAdditional characters that are considered valid.
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Strings

Changelog

VersionDescription
3.0.0Templates changed
0.5.0Created

See Also