Back to Validation

GreaterThanOrEqual

docs/validators/GreaterThanOrEqual.md

3.1.12.1 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]> -->

GreaterThanOrEqual

  • GreaterThanOrEqual(mixed $compareTo)

Validates whether the input is greater than or equal to a value.

php
v::intVal()->greaterThanOrEqual(10)->assert(10);
// Validation passes successfully

v::intVal()->greaterThanOrEqual(10)->assert(9);
// → 9 must be greater than or equal to 10

v::intVal()->greaterThanOrEqual(10)->assert(11);
// Validation passes successfully

Validation makes comparison easier, check out our supported comparable values.

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

Templates

GreaterThanOrEqual::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be greater than or equal to {{compareTo}}
inverted{{subject}} must be less than {{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
3.0.0Renamed from "Min" to "GreaterThanOrEqual"
2.0.0Became always inclusive
1.0.0Became inclusive by default
0.3.9Created

See Also