Back to Validation

Multiple

docs/validators/Multiple.md

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

Multiple

  • Multiple(int $multipleOf)

Validates if the input is a multiple of the given parameter

php
v::intVal()->multiple(3)->assert(9);
// Validation passes successfully

Templates

Multiple::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a multiple of {{multipleOf}}
inverted{{subject}} must not be a multiple of {{multipleOf}}

Template placeholders

PlaceholderDescription
multipleOf
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Math
  • Numbers

Changelog

VersionDescription
0.3.9Created

See Also