ValidatesAttributes
trait ValidatesAttributes
Methods
Validate that an attribute was "accepted".
Validate that an attribute was "accepted" when another attribute has a given value.
Validate that an attribute was "declined".
Validate that an attribute was "declined" when another attribute has a given value.
Validate that an attribute is an active URL.
Get the DNS records for the given hostname.
Validate that an attribute is 7 bit ASCII.
Validate that an attribute is a valid Base64 string.
"Break" on first validation fail.
Validate the date is before a given date.
Validate the date is before or equal a given date.
Validate the date is after a given date.
Validate the date is equal or after a given date.
Compare a given date against another using an operator.
Get the date format for an attribute if it has one.
Get the date timestamp.
Compare a date value with a literal or referenced field using the given format.
Get a DateTime instance from a supported value using the given format.
Get a DateTime instance from a string with no format.
Validate that an attribute contains only alphabetic characters.
Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
Validate that an attribute contains only alpha-numeric characters.
Validate that an attribute is an array.
Get the accepted literal and encoded array keys.
Validate that an array does not contain any keys other than the given keys.
Validate that an attribute is a list.
Validate that an array has all of the given keys.
Validate the size of an attribute is between a set of values.
Validate that an attribute is a boolean.
Validate that an attribute has a matching confirmation.
Validate an attribute contains a list of values.
Validate an attribute does not contain a list of values.
Validate that the password of the currently authenticated user matches the given value.
Validate that an attribute is a valid date.
Determine if a value is a valid date.
Validate that an attribute matches a date format.
Determine if a value matches a specific date format.
Validate that an attribute is equal to another date.
Validate that an attribute has a given number of decimal places.
Validate that an attribute is different from another attribute.
Validate that an attribute has a given number of digits.
Validate that an attribute is between a given number of digits.
Validate the dimensions of an image matches the given values.
Test if the given width and height fail any conditions.
Determine if the given parameters fail a dimension ratio check.
Validate an attribute is unique among other values.
Get the values to distinct between.
Extract the distinct values from the data.
Validate that an attribute is a valid e-mail address.
Determine if a value is a valid email address using basic RFC validation.
Validate the encoding of an attribute.
Validate the existence of an attribute value in a database table.
Get the number of records that exist in storage.
Validate the uniqueness of an attribute value on a given database table.
Get the excluded ID column and value for the unique rule.
Prepare the given ID for querying.
Get the extra conditions for a unique rule.
Parse the connection / table for the unique / exists rules.
Get the column name for an exists / unique query.
Guess the database column from the given attribute name.
Get the extra conditions for a unique / exists rule.
Validate the extension of a file upload attribute is in a set of defined extensions.
Validate the given value is a valid file.
Validate the given attribute is filled if it is present.
Validate that an attribute is greater than another attribute.
Validate that an attribute is less than another attribute.
Validate that an attribute is greater than or equal another attribute.
Validate that an attribute is less than or equal another attribute.
Validate that an attribute is lowercase.
Validate that an attribute is uppercase.
Validate that an attribute is a valid HEX color.
Validate the MIME type of a file is an image MIME type.
Validate an attribute is contained within a list of values.
Validate that the values of an attribute are in another attribute.
Validate that an array contains at least one of the given keys.
Validate that an attribute is an integer.
Validate that an attribute is a valid IP.
Validate that an attribute is a valid IPv4.
Validate that an attribute is a valid IPv6.
Determine if a value is a valid IP address (any version).
Determine if a value is a valid IPv4 address.
Determine if a value is a valid IPv6 address.
Validate that an attribute is a valid MAC address.
Validate the attribute is a valid JSON string.
Validate the size of an attribute is less than or equal to a maximum value.
Validate that an attribute has a maximum number of digits.
Validate the guessed extension of a file upload is in a set of file extensions.
Validate the MIME type of a file upload attribute is in a set of MIME types.
Check if PHP uploads are explicitly allowed.
Validate the size of an attribute is greater than or equal to a minimum value.
Validate that an attribute has a minimum number of digits.
Validate that an attribute is missing.
Validate that an attribute is missing when another attribute has a given value.
Validate that an attribute is missing unless another attribute has a given value.
Validate that an attribute is missing when any given attribute is present.
Validate that an attribute is missing when all given attributes are present.
Validate the value of an attribute is a multiple of a given value.
Determine if a value is an exact multiple of a divisor.
"Indicate" validation should pass if value is null.
Validate an attribute is not contained within a list of values.
Validate that an attribute is numeric.
Validate that an attribute exists even if not filled.
Validate that an attribute is present when another attribute has a given value.
Validate that an attribute is present unless another attribute has a given value.
Validate that an attribute is present when any given attribute is present.
Validate that an attribute is present when all given attributes are present.
Validate that an attribute passes a regular expression check.
Validate that an attribute does not pass a regular expression check.
Validate that a required attribute exists.
Validate that an attribute exists when another attribute has a given value.
Validate that an attribute exists when another attribute was "accepted".
Validate that an attribute exists when another attribute was "declined".
Validate that an attribute does not exist or is an empty string.
Validate that an attribute does not exist when another attribute has a given value.
Validate that an attribute does not exist when another attribute was "accepted".
Validate that an attribute does not exist when another attribute was "declined".
Validate that an attribute does not exist unless another attribute has a given value.
Validate that other attributes do not exist when this attribute exists.
Indicate that an attribute is excluded.
Indicate that an attribute should be excluded when another attribute has a given value.
Indicate that an attribute should be excluded when another attribute does not have a given value.
Validate that an attribute exists when another attribute does not have a given value.
Indicate that an attribute should be excluded when another attribute presents.
Indicate that an attribute should be excluded when another attribute is missing.
Prepare the values and the other value for validation.
Check if parameter should be converted to boolean.
Convert the given values to boolean if they are string "true" / "false".
Convert the given values to null if they are string "null".
Validate that an attribute exists when any other attribute exists.
Validate that an attribute exists when all other attributes exist.
Validate that an attribute exists when another attribute does not.
Validate that an attribute exists when all other attributes do not.
Determine if any of the given attributes fail the required test.
Determine if all of the given attributes fail the required test.
Validate that two attributes match.
Validate the size of an attribute.
"Validate" optional attributes.
Validate the attribute starts with a given substring.
Validate the attribute does not start with a given substring.
Validate the attribute ends with a given substring.
Validate the attribute does not end with a given substring.
Validate that an attribute is a string.
Validate that an attribute is a valid timezone.
Validate that an attribute is a valid URL.
Validate that an attribute is a valid ULID.
Determine if a value is a valid ULID.
Validate that an attribute is a valid UUID.
Determine if a value is a valid UUID (any version).
Get the size of an attribute.
Compute the validation size from numeric semantics and runtime value shape.
Check that the given value is a valid file instance.
Determine if a comparison passes between the given values.
Parse named parameters to $key => $value items.
Require a certain number of parameters to be present.
Check if the parameters are of the same type.
Adds the existing rule to the numericRules array if the attribute's value is numeric.
Trim the value if it is a string.
Ensure the exponent is within the allowed range.
Details
at line 48
bool
validateAccepted(string $attribute, mixed $value)
Validate that an attribute was "accepted".
This validation rule implies the attribute is "required".
at line 58
bool
validateAcceptedIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute was "accepted" when another attribute has a given value.
at line 78
bool
validateDeclined(string $attribute, mixed $value)
Validate that an attribute was "declined".
This validation rule implies the attribute is "required".
at line 88
bool
validateDeclinedIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute was "declined" when another attribute has a given value.
at line 106
bool
validateActiveUrl(string $attribute, mixed $value)
Validate that an attribute is an active URL.
at line 130
protected array|false
getDnsRecords(string $hostname, int $type)
Get the DNS records for the given hostname.
at line 149
bool
validateAscii(string $attribute, mixed $value)
Validate that an attribute is 7 bit ASCII.
at line 157
bool
validateBase64(string $attribute, mixed $value)
Validate that an attribute is a valid Base64 string.
at line 173
bool
validateBail()
"Break" on first validation fail.
Always returns true, just lets us put "bail" in rules.
at line 183
bool
validateBefore(string $attribute, mixed $value, mixed $parameters)
Validate the date is before a given date.
at line 195
bool
validateBeforeOrEqual(string $attribute, mixed $value, mixed $parameters)
Validate the date is before or equal a given date.
at line 207
bool
validateAfter(string $attribute, mixed $value, mixed $parameters)
Validate the date is after a given date.
at line 219
bool
validateAfterOrEqual(string $attribute, mixed $value, mixed $parameters)
Validate the date is equal or after a given date.
at line 231
protected bool
compareDates(string $attribute, mixed $value, array $parameters, string $operator)
Compare a given date against another using an operator.
at line 261
protected string|null
getDateFormat(string $attribute)
Get the date format for an attribute if it has one.
at line 277
protected int|null
getDateTimestamp(mixed $value)
Get the date timestamp.
at line 292
protected bool
checkDateTimeOrder(string $format, mixed $value, mixed $argument, string $operator)
Compare a date value with a literal or referenced field using the given format.
at line 325
protected DateTimeInterface|null
getDateTimeWithOptionalFormat(string $format, mixed $value)
Get a DateTime instance from a supported value using the given format.
at line 345
protected DateTimeInterface|null
getDateTime(DateTimeInterface|float|int|string $value)
Get a DateTime instance from a string with no format.
at line 361
bool
validateAlpha(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute contains only alphabetic characters.
If the 'ascii' option is passed, validate that an attribute contains only ascii alphabetic characters.
at line 377
bool
validateAlphaDash(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute contains only alpha-numeric characters, dashes, and underscores.
If the 'ascii' option is passed, validate that an attribute contains only ascii alpha-numeric characters, dashes, and underscores.
at line 396
bool
validateAlphaNum(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute contains only alpha-numeric characters.
If the 'ascii' option is passed, validate that an attribute contains only ascii alpha-numeric characters.
at line 414
bool
validateArray(string $attribute, mixed $value, array $parameters = [])
Validate that an attribute is an array.
at line 433
protected array
acceptedArrayKeys(array $parameters)
Get the accepted literal and encoded array keys.
at line 446
bool
validateArrayKeys(string $attribute, mixed $value, array $parameters)
Validate that an array does not contain any keys other than the given keys.
at line 460
bool
validateList(string $attribute, mixed $value)
Validate that an attribute is a list.
at line 470
bool
validateRequiredArrayKeys(string $attribute, mixed $value, array $parameters)
Validate that an array has all of the given keys.
at line 491
bool
validateBetween(string $attribute, mixed $value, array $parameters)
Validate the size of an attribute is between a set of values.
at line 510
bool
validateBoolean(string $attribute, mixed $value, array $parameters)
Validate that an attribute is a boolean.
at line 526
bool
validateConfirmed(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute has a matching confirmation.
at line 536
bool
validateContains(string $attribute, mixed $value, mixed $parameters)
Validate an attribute contains a list of values.
at line 557
bool
validateDoesntContain(string $attribute, mixed $value, mixed $parameters)
Validate an attribute does not contain a list of values.
at line 578
protected bool
validateCurrentPassword(string $attribute, mixed $value, mixed $parameters)
Validate that the password of the currently authenticated user matches the given value.
at line 595
bool
validateDate(string $attribute, mixed $value)
Validate that an attribute is a valid date.
at line 607
protected bool
isValidDate(mixed $value)
Determine if a value is a valid date.
Accepts DateTimeInterface instances, numeric timestamps, and string date representations. Validates via strtotime() and date_parse() + checkdate() to reject dates like February 30th.
at line 631
bool
validateDateFormat(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute matches a date format.
at line 654
protected bool
matchesDateFormat(mixed $value, string $format)
Determine if a value matches a specific date format.
Creates a DateTime from the format and verifies round-trip formatting produces the same string. Catches ValueError for invalid format strings.
at line 675
bool
validateDateEquals(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is equal to another date.
at line 687
bool
validateDecimal(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute has a given number of decimal places.
at line 716
bool
validateDifferent(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is different from another attribute.
at line 738
bool
validateDigits(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute has a given number of digits.
at line 752
bool
validateDigitsBetween(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is between a given number of digits.
at line 771
bool
validateDimensions(string $attribute, mixed $value, mixed $parameters)
Validate the dimensions of an image matches the given values.
at line 808
protected bool
failsBasicDimensionChecks(array $parameters, int $width, int $height)
Test if the given width and height fail any conditions.
at line 821
protected bool
failsRatioCheck(array $parameters, int $width, int $height)
Determine if the given parameters fail a dimension ratio check.
at line 880
bool
validateDistinct(string $attribute, mixed $value, mixed $parameters)
Validate an attribute is unique among other values.
at line 900
protected array
getDistinctValues(string $attribute)
Get the values to distinct between.
at line 919
protected array
extractDistinctValues(string $attribute)
Extract the distinct values from the data.
at line 938
bool
validateEmail(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is a valid e-mail address.
at line 977
protected bool
isValidEmail(string $value)
Determine if a value is a valid email address using basic RFC validation.
Used by the inline check for the bare email rule token. The
parameterized form (email:rfc,dns,spoof,filter,...) stays in
validateEmail() and flows through the delegated path.
at line 995
bool
validateEncoding(string $attribute, mixed $value, array $parameters)
Validate the encoding of an attribute.
at line 1017
bool
validateExists(string $attribute, mixed $value, mixed $parameters)
Validate the existence of an attribute value in a database table.
at line 1048
protected int
getExistCount(mixed $connection, string $table, string $column, mixed $value, array $parameters)
Get the number of records that exist in storage.
at line 1072
bool
validateUnique(string $attribute, mixed $value, mixed $parameters)
Validate the uniqueness of an attribute value on a given database table.
If a database column is not specified, the attribute will be used.
at line 1119
protected array
getUniqueIds(string|null $idColumn, array $parameters)
Get the excluded ID column and value for the unique rule.
at line 1129
protected int|string|null
prepareUniqueId(mixed $id)
Prepare the given ID for querying.
at line 1151
protected array
getUniqueExtra(array $parameters)
Get the extra conditions for a unique rule.
at line 1165
array
parseTable(string $table)
Parse the connection / table for the unique / exists rules.
at line 1193
bool|string
getQueryColumn(array $parameters, string $attribute)
Get the column name for an exists / unique query.
at line 1203
string
guessColumnForQuery(string $attribute)
Guess the database column from the given attribute name.
at line 1217
protected array
getExtraConditions(array $segments)
Get the extra conditions for a unique / exists rule.
at line 1235
bool
validateExtensions(string $attribute, mixed $value, array $parameters)
Validate the extension of a file upload attribute is in a set of defined extensions.
at line 1251
bool
validateFile(string $attribute, mixed $value)
Validate the given value is a valid file.
at line 1259
bool
validateFilled(string $attribute, mixed $value)
Validate the given attribute is filled if it is present.
at line 1273
bool
validateGt(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is greater than another attribute.
at line 1317
bool
validateLt(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is less than another attribute.
at line 1361
bool
validateGte(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is greater than or equal another attribute.
at line 1405
bool
validateLte(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is less than or equal another attribute.
at line 1447
bool
validateLowercase(string $attribute, mixed $value)
Validate that an attribute is lowercase.
at line 1455
bool
validateUppercase(string $attribute, mixed $value)
Validate that an attribute is uppercase.
at line 1463
bool
validateHexColor(string $attribute, mixed $value)
Validate that an attribute is a valid HEX color.
at line 1474
bool
validateImage(string $attribute, mixed $value, array $parameters = [])
Validate the MIME type of a file is an image MIME type.
at line 1490
bool
validateIn(string $attribute, mixed $value, mixed $parameters)
Validate an attribute is contained within a list of values.
at line 1518
bool
validateInArray(string $attribute, mixed $value, mixed $parameters)
Validate that the values of an attribute are in another attribute.
at line 1538
bool
validateInArrayKeys(string $attribute, mixed $value, array $parameters)
Validate that an array contains at least one of the given keys.
at line 1563
bool
validateInteger(string $attribute, mixed $value, array $parameters = [])
Validate that an attribute is an integer.
at line 1575
bool
validateIp(string $attribute, mixed $value)
Validate that an attribute is a valid IP.
at line 1583
bool
validateIpv4(string $attribute, mixed $value)
Validate that an attribute is a valid IPv4.
at line 1591
bool
validateIpv6(string $attribute, mixed $value)
Validate that an attribute is a valid IPv6.
at line 1599
protected bool
isValidIp(string $value)
Determine if a value is a valid IP address (any version).
at line 1607
protected bool
isValidIpv4(string $value)
Determine if a value is a valid IPv4 address.
at line 1615
protected bool
isValidIpv6(string $value)
Determine if a value is a valid IPv6 address.
at line 1623
bool
validateMacAddress(string $attribute, mixed $value)
Validate that an attribute is a valid MAC address.
at line 1631
bool
validateJson(string $attribute, mixed $value)
Validate the attribute is a valid JSON string.
at line 1645
bool
validateMax(string $attribute, mixed $value, mixed $parameters)
Validate the size of an attribute is less than or equal to a maximum value.
at line 1665
bool
validateMaxDigits(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute has a maximum number of digits.
at line 1683
bool
validateMimes(string $attribute, mixed $value, mixed $parameters)
Validate the guessed extension of a file upload is in a set of file extensions.
at line 1705
bool
validateMimetypes(string $attribute, mixed $value, mixed $parameters)
Validate the MIME type of a file upload attribute is in a set of MIME types.
at line 1725
protected bool
shouldBlockPhpUpload(mixed $value, array $parameters)
Check if PHP uploads are explicitly allowed.
at line 1752
bool
validateMin(string $attribute, mixed $value, mixed $parameters)
Validate the size of an attribute is greater than or equal to a minimum value.
at line 1768
bool
validateMinDigits(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute has a minimum number of digits.
at line 1788
bool
validateMissing(mixed $attribute, mixed $value, array<int, int|string> $parameters)
Validate that an attribute is missing.
at line 1798
bool
validateMissingIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is missing when another attribute has a given value.
at line 1816
bool
validateMissingUnless(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is missing unless another attribute has a given value.
at line 1834
bool
validateMissingWith(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is missing when any given attribute is present.
at line 1850
bool
validateMissingWithAll(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is missing when all given attributes are present.
at line 1868
bool
validateMultipleOf(string $attribute, mixed $value, mixed $parameters)
Validate the value of an attribute is a multiple of a given value.
at line 1880
protected bool
isMultipleOf(mixed $value, mixed $divisor)
Determine if a value is an exact multiple of a divisor.
at line 1913
bool
validateNullable()
"Indicate" validation should pass if value is null.
Always returns true, just lets us put "nullable" in rules.
at line 1923
bool
validateNotIn(string $attribute, mixed $value, mixed $parameters)
Validate an attribute is not contained within a list of values.
at line 1933
bool
validateNumeric(string $attribute, mixed $value, array $parameters = [])
Validate that an attribute is numeric.
at line 1945
bool
validatePresent(string $attribute, mixed $value)
Validate that an attribute exists even if not filled.
at line 1955
bool
validatePresentIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is present when another attribute has a given value.
at line 1973
bool
validatePresentUnless(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is present unless another attribute has a given value.
at line 1991
bool
validatePresentWith(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is present when any given attribute is present.
at line 2007
bool
validatePresentWithAll(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is present when all given attributes are present.
at line 2023
bool
validateRegex(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute passes a regular expression check.
at line 2039
bool
validateNotRegex(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute does not pass a regular expression check.
at line 2053
bool
validateRequired(string $attribute, mixed $value)
Validate that a required attribute exists.
at line 2074
bool
validateRequiredIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when another attribute has a given value.
at line 2094
bool
validateRequiredIfAccepted(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when another attribute was "accepted".
at line 2108
bool
validateRequiredIfDeclined(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when another attribute was "declined".
at line 2122
bool
validateProhibited(string $attribute, mixed $value)
Validate that an attribute does not exist or is an empty string.
at line 2130
bool
validateProhibitedIf(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute does not exist when another attribute has a given value.
at line 2146
bool
validateProhibitedIfAccepted(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute does not exist when another attribute was "accepted".
at line 2160
bool
validateProhibitedIfDeclined(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute does not exist when another attribute was "declined".
at line 2174
bool
validateProhibitedUnless(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute does not exist unless another attribute has a given value.
at line 2190
bool
validateProhibits(string $attribute, mixed $value, mixed $parameters)
Validate that other attributes do not exist when this attribute exists.
at line 2206
bool
validateExclude()
Indicate that an attribute is excluded.
at line 2214
bool
validateExcludeIf(string $attribute, mixed $value, mixed $parameters)
Indicate that an attribute should be excluded when another attribute has a given value.
at line 2230
bool
validateExcludeUnless(string $attribute, mixed $value, mixed $parameters)
Indicate that an attribute should be excluded when another attribute does not have a given value.
at line 2242
bool
validateRequiredUnless(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when another attribute does not have a given value.
at line 2258
bool
validateExcludeWith(string $attribute, mixed $value, mixed $parameters)
Indicate that an attribute should be excluded when another attribute presents.
at line 2272
bool
validateExcludeWithout(string $attribute, mixed $value, mixed $parameters)
Indicate that an attribute should be excluded when another attribute is missing.
at line 2288
array
parseDependentRuleParameters(array $parameters)
Prepare the values and the other value for validation.
at line 2308
protected bool
shouldConvertToBoolean(string $parameter)
Check if parameter should be converted to boolean.
at line 2316
protected array
convertValuesToBoolean(array $values)
Convert the given values to boolean if they are string "true" / "false".
at line 2328
protected array
convertValuesToNull(array $values)
Convert the given values to null if they are string "null".
at line 2338
bool
validateRequiredWith(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when any other attribute exists.
at line 2350
bool
validateRequiredWithAll(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when all other attributes exist.
at line 2362
bool
validateRequiredWithout(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when another attribute does not.
at line 2374
bool
validateRequiredWithoutAll(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute exists when all other attributes do not.
at line 2386
protected bool
anyFailingRequired(array $attributes)
Determine if any of the given attributes fail the required test.
at line 2401
protected bool
allFailingRequired(array $attributes)
Determine if all of the given attributes fail the required test.
at line 2418
bool
validateSame(string $attribute, mixed $value, mixed $parameters)
Validate that two attributes match.
at line 2432
bool
validateSize(string $attribute, mixed $value, mixed $parameters)
Validate the size of an attribute.
at line 2448
bool
validateSometimes()
"Validate" optional attributes.
Always returns true, just lets us put sometimes in rules.
at line 2458
bool
validateStartsWith(string $attribute, mixed $value, mixed $parameters)
Validate the attribute starts with a given substring.
at line 2472
bool
validateDoesntStartWith(string $attribute, mixed $value, mixed $parameters)
Validate the attribute does not start with a given substring.
at line 2486
bool
validateEndsWith(string $attribute, mixed $value, mixed $parameters)
Validate the attribute ends with a given substring.
at line 2500
bool
validateDoesntEndWith(string $attribute, mixed $value, mixed $parameters)
Validate the attribute does not end with a given substring.
at line 2512
bool
validateString(string $attribute, mixed $value)
Validate that an attribute is a string.
at line 2522
bool
validateTimezone(string $attribute, mixed $value, array $parameters = [])
Validate that an attribute is a valid timezone.
at line 2542
bool
validateUrl(string $attribute, mixed $value, array $parameters = [])
Validate that an attribute is a valid URL.
at line 2550
bool
validateUlid(string $attribute, mixed $value)
Validate that an attribute is a valid ULID.
at line 2558
protected bool
isValidUlid(string $value)
Determine if a value is a valid ULID.
at line 2568
bool
validateUuid(string $attribute, mixed $value, mixed $parameters)
Validate that an attribute is a valid UUID.
at line 2590
protected bool
isValidUuid(string $value)
Determine if a value is a valid UUID (any version).
Used by the inline check for the bare uuid rule token. The
parameterized form (uuid:4, uuid:max) stays in validateUuid()
and flows through the delegated path.
at line 2598
protected float|int|string
getSize(string $attribute, mixed $value)
Get the size of an attribute.
at line 2610
protected float|int|string
sizeOf(string $attribute, mixed $value, bool $numeric)
Compute the validation size from numeric semantics and runtime value shape.
at line 2630
bool
isValidFileInstance(mixed $value)
Check that the given value is a valid file instance.
at line 2644
protected bool
compare(mixed $first, mixed $second, string $operator)
Determine if a comparison passes between the given values.
at line 2663
array|null
parseNamedParameters(array $parameters)
Parse named parameters to $key => $value items.
at line 2679
void
requireParameterCount(int $count, array $parameters, string $rule)
Require a certain number of parameters to be present.
at line 2689
protected bool
isSameType(mixed $first, mixed $second)
Check if the parameters are of the same type.
at line 2697
protected void
shouldBeNumeric(string $attribute, string $rule)
Adds the existing rule to the numericRules array if the attribute's value is numeric.
at line 2707
protected mixed
trim(mixed $value)
Trim the value if it is a string.
at line 2715
protected mixed
ensureExponentWithinAllowedRange(string $attribute, mixed $value)
Ensure the exponent is within the allowed range.