Laravel Validation Rules (13.x)
Complete reference for all 109 validation rules in Laravel 13.x. Search, browse by category, and copy rules instantly.
No rules match your search.
Try a different keyword or clear the search.
Booleans
5accepted
The field under validation must be "yes", "on", 1, "1", true, or "true". This is useful for validating "Terms of Service" acceptance or similar fields.
accepted_if:anotherfield,value,...
The field under validation must be "yes", "on", 1, "1", true, or "true" if another field under validation is equal to a specified value. This is useful for validating "Terms of Service" acceptance or similar fields.
boolean
The field under validation must be able to be cast as a boolean. Accepted input are true, false, 1, 0, "1", and "0".
declined
The field under validation must be "no", "off", 0, "0", false, or "false".
declined_if:anotherfield,value,...
The field under validation must be "no", "off", 0, "0", false, or "false" if another field under validation is equal to a specified value.
Strings
27active_url
The field under validation must have a valid A or AAAA record according to the dns_get_record PHP function. The hostname of the provided URL is extracted using the parse_url PHP function before being passed to dns_get_record.
alpha
The field under validation must be entirely Unicode alphabetic characters contained in \p{L} and \p{M}.
alpha_dash
The field under validation must be entirely Unicode alpha-numeric characters contained in \p{L}, \p{M}, \p{N}, as well as ASCII dashes (-) and ASCII underscores (_).
alpha_num
The field under validation must be entirely Unicode alpha-numeric characters contained in \p{L}, \p{M}, and \p{N}.
ascii
The field under validation must be entirely 7-bit ASCII characters.
confirmed
The field under validation must have a matching field of {field}_confirmation. For example, if the field under validation is password, a matching password_confirmation field must be present in the input.
current_password
The field under validation must match the authenticated user's password. You may specify an authentication guard using the rule's first parameter:
doesnt_end_with:_foo_,_bar_,...
The field under validation must not end with one of the given values.
doesnt_start_with:_foo_,_bar_,...
The field under validation must not start with one of the given values.
email
The field under validation must be formatted as an email address. This validation rule utilizes the egulias/email-validator package for validating the email address.
ends_with:_foo_,_bar_,...
The field under validation must end with one of the given values.
enum
The Enum rule is a class-based rule that validates whether the field under validation contains a valid enum value. The Enum rule accepts the name of the enum as its only constructor argument.
hex_color
The field under validation must contain a valid color value in hexadecimal format.
in:_foo_,_bar_,...
The field under validation must be included in the given list of values. Since this rule often requires you to implode an array, the Rule::in method may be used to fluently construct the rule:
ip
The field under validation must be an IP address.
json
The field under validation must be a valid JSON string.
lowercase
The field under validation must be lowercase.
mac_address
The field under validation must be a MAC address.
not_in:_foo_,_bar_,...
The field under validation must not be included in the given list of values. The Rule::notIn method may be used to fluently construct the rule:
not_regex:_pattern_
The field under validation must not match the given regular expression.
regex:_pattern_
The field under validation must match the given regular expression.
starts_with:_foo_,_bar_,...
The field under validation must start with one of the given values.
string
The field under validation must be a string. If you would like to allow the field to also be null, you should assign the nullable rule to the field.
ulid
The field under validation must be a valid Universally Unique Lexicographically Sortable Identifier (ULID).
uppercase
The field under validation must be uppercase.
url
The field under validation must be a valid URL.
uuid
The field under validation must be a valid RFC 9562 (version 1, 3, 4, 5, 6, 7, or 8) universally unique identifier (UUID).
Numbers
13decimal:_min_,_max_
The field under validation must be numeric and must contain the specified number of decimal places:
digits:_value_
The integer under validation must have an exact length of _value_.
digits_between:_min_,_max_
The integer under validation must have a length between the given _min_ and _max_.
gt:_field_
The field under validation must be greater than the given _field_ or _value_. The two fields must be of the same type.
gte:_field_
The field under validation must be greater than or equal to the given _field_ or _value_. The two fields must be of the same type.
integer
The field under validation must be an integer.
lt:_field_
The field under validation must be less than the given _field_. The two fields must be of the same type.
lte:_field_
The field under validation must be less than or equal to the given _field_. The two fields must be of the same type.
max_digits:_value_
The integer under validation must have a maximum length of _value_.
min_digits:_value_
The integer under validation must have a minimum length of _value_.
multiple_of:_value_
The field under validation must be a multiple of _value_.
numeric
The field under validation must be numeric.
same:_field_
The given _field_ must match the field under validation.
Arrays
8array
The field under validation must be a PHP array.
contains:_foo_,_bar_,...
The field under validation must be an array that contains all of the given parameter values. Since this rule often requires you to implode an array, the Rule::contains method may be used to fluently construct the rule:
distinct
When validating arrays, the field under validation must not have any duplicate values:
doesnt_contain:_foo_,_bar_,...
The field under validation must be an array that does not contain any of the given parameter values. Since this rule often requires you to implode an array, the Rule::doesntContain method may be used to fluently construct the rule:
in_array:_anotherfield_.*
The field under validation must exist in _anotherfield_'s values.
in_array_keys:_value_.*
The field under validation must be an array having at least one of the given _values_ as a key within the array:
list
The field under validation must be an array that is a list. An array is considered a list if its keys consist of consecutive numbers from 0 to count($array) - 1.
min:_value_
The field under validation must have a minimum _value_. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.
Dates
9after:_date_
The field under validation must be a value after a given date. The dates will be passed into the strtotime PHP function in order to be converted to a valid DateTime instance:
after_or_equal:_date_
The field under validation must be a value after or equal to the given date. For more information, see the after rule.
before:_date_
The field under validation must be a value preceding the given date. The dates will be passed into the PHP strtotime function in order to be converted into a valid DateTime instance.
before_or_equal:_date_
The field under validation must be a value preceding or equal to the given date. The dates will be passed into the PHP strtotime function in order to be converted into a valid DateTime instance.
date
The field under validation must be a valid, non-relative date according to the strtotime PHP function.
date_equals:_date_
The field under validation must be equal to the given date. The dates will be passed into the PHP strtotime function in order to be converted into a valid DateTime instance.
date_format:_format_,...
The field under validation must match one of the given _formats_. You should use either date or date_format when validating a field, not both.
different:_field_
The field under validation must have a different value than _field_.
timezone
The field under validation must be a valid timezone identifier according to the DateTimeZone::listIdentifiers method.
Files
10between:_min_,_max_
The field under validation must have a size between the given _min_ and _max_ (inclusive). Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.
dimensions
The file under validation must be an image meeting the dimension constraints as specified by the rule's parameters:
encoding:*encoding_type*
The field under validation must match the specified character encoding. This rule uses PHP's mb_check_encoding function to verify the encoding of the given file or string value.
extensions:_foo_,_bar_,...
The file under validation must have a user-assigned extension corresponding to one of the listed extensions:
file
The field under validation must be a successfully uploaded file.
image
The file under validation must be an image (jpg, jpeg, png, bmp, gif, or webp).
max:_value_
The field under validation must be less than or equal to a maximum _value_. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.
mimes:_foo_,_bar_,...
The file under validation must have a MIME type corresponding to one of the listed extensions:
mimetypes:_text/plain_,...
The file under validation must match one of the given MIME types:
size:_value_
The field under validation must have a size matching the given _value_. For string data, _value_ corresponds to the number of characters.
Database
2exists:_table_,_column_
The field under validation must exist in a given database table.
unique:_table_,_column_
The field under validation must not exist within the given database table.
Utilities
35anyOf
The Rule::anyOf validation rule allows you to specify that the field under validation must satisfy any of the given validation rulesets. For example, the following rule will validate that the username field is either an email address or an alpha-numeric string (including dashes) that is at least 6 characters long:
bail
Stop running validation rules for the field after the first validation failure.
exclude
The field under validation will be excluded from the request data returned by the validate and validated methods.
exclude_if:_anotherfield_,_value_
The field under validation will be excluded from the request data returned by the validate and validated methods if the _anotherfield_ field is equal to _value_.
exclude_unless:_anotherfield_,_value_
The field under validation will be excluded from the request data returned by the validate and validated methods unless _anotherfield_'s field is equal to _value_. If _value_ is null (exclude_unless:name,null), the field under validation will be excluded unless the comparison field is null or the comparison field is missing from the request data.
exclude_with:_anotherfield_
The field under validation will be excluded from the request data returned by the validate and validated methods if the _anotherfield_ field is present.
exclude_without:_anotherfield_
The field under validation will be excluded from the request data returned by the validate and validated methods if the _anotherfield_ field is not present.
filled
The field under validation must not be empty when it is present.
missing
The field under validation must not be present in the input data.
missing_if:_anotherfield_,_value_,...
The field under validation must not be present if the _anotherfield_ field is equal to any _value_.
missing_unless:_anotherfield_,_value_
The field under validation must not be present unless the _anotherfield_ field is equal to any _value_.
missing_with:_foo_,_bar_,...
The field under validation must not be present _only if_ any of the other specified fields are present.
missing_with_all:_foo_,_bar_,...
The field under validation must not be present _only if_ all of the other specified fields are present.
nullable
The field under validation may be null.
present
The field under validation must exist in the input data.
present_if:_anotherfield_,_value_,...
The field under validation must be present if the _anotherfield_ field is equal to any _value_.
present_unless:_anotherfield_,_value_
The field under validation must be present unless the _anotherfield_ field is equal to any _value_.
present_with:_foo_,_bar_,...
The field under validation must be present _only if_ any of the other specified fields are present.
present_with_all:_foo_,_bar_,...
The field under validation must be present _only if_ all of the other specified fields are present.
prohibited
The field under validation must be missing or empty. A field is "empty" if it meets one of the following criteria:
prohibited_if:_anotherfield_,_value_,...
The field under validation must be missing or empty if the _anotherfield_ field is equal to any _value_. A field is "empty" if it meets one of the following criteria:
prohibited_if_accepted:_anotherfield_,...
The field under validation must be missing or empty if the _anotherfield_ field is equal to "yes", "on", 1, "1", true, or "true".
prohibited_if_declined:_anotherfield_,...
The field under validation must be missing or empty if the _anotherfield_ field is equal to "no", "off", 0, "0", false, or "false".
prohibited_unless:_anotherfield_,_value_,...
The field under validation must be missing or empty unless the _anotherfield_ field is equal to any _value_. A field is "empty" if it meets one of the following criteria:
prohibits:_anotherfield_,...
If the field under validation is not missing or empty, all fields in _anotherfield_ must be missing or empty. A field is "empty" if it meets one of the following criteria:
required
The field under validation must be present in the input data and not empty. A field is "empty" if it meets one of the following criteria:
required_array_keys:_foo_,_bar_,...
The field under validation must be an array and must contain at least the specified keys.
required_if:_anotherfield_,_value_,...
The field under validation must be present and not empty if the _anotherfield_ field is equal to any _value_.
required_if_accepted:_anotherfield_,...
The field under validation must be present and not empty if the _anotherfield_ field is equal to "yes", "on", 1, "1", true, or "true".
required_if_declined:_anotherfield_,...
The field under validation must be present and not empty if the _anotherfield_ field is equal to "no", "off", 0, "0", false, or "false".
required_unless:_anotherfield_,_value_,...
The field under validation must be present and not empty unless the _anotherfield_ field is equal to any _value_. This also means _anotherfield_ must be present in the request data unless _value_ is null.
required_with:_foo_,_bar_,...
The field under validation must be present and not empty _only if_ any of the other specified fields are present and not empty.
required_with_all:_foo_,_bar_,...
The field under validation must be present and not empty _only if_ all of the other specified fields are present and not empty.
required_without:_foo_,_bar_,...
The field under validation must be present and not empty _only when_ any of the other specified fields are empty or not present.
required_without_all:_foo_,_bar_,...
The field under validation must be present and not empty _only when_ all of the other specified fields are empty or not present.