Back to Validation

Equals

docs/validators/Equals.md

3.1.11.6 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> -->

Equals

  • Equals(mixed $compareTo)

Validates if the input is equal to some value.

php
v::equals('alganet')->assert('alganet');
// Validation passes successfully

Message template for this validator includes {{compareTo}}.

Templates

Equals::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be equal to {{compareTo}}
inverted{{subject}} must not be equal to {{compareTo}}

Template placeholders

PlaceholderDescription
compareToValue to be compared against the input.
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Comparisons

Changelog

VersionDescription
1.0.0Removed identical checking (see Identical)
0.3.9Created

See Also