Back to Validation

Base64

docs/validators/Base64.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]> SPDX-FileContributor: Jens Segers <[email protected]> -->

Base64

  • Base64()

Validate if a string is Base64-encoded.

php
v::base64()->assert('cmVzcGVjdCE=');
// Validation passes successfully

v::base64()->assert('respect!');
// → "respect!" must be a base64-encoded string

Templates

Base64::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a base64-encoded string
inverted{{subject}} must not be a base64-encoded string

Template placeholders

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

Categorization

  • Strings

Changelog

VersionDescription
3.0.0Templates changed
2.0.0Created

See Also