📄️ Validation Rules List
The following rules are the builtin validation rules in Warlock:
📄️ Array Of
Check if the input is an array of the given type.
📄️ Array
Check if the input is an array regardless the content type of the array.
📄️ Boolean
Check if the input is a boolean.
📄️ Confirmed
Check if the input value is confirmed by another input value.
📄️ Date
Check if the input value is a valid date.
Check if the input value is a valid email address.
📄️ Exists
Check if the input value exists in the database.
📄️ File
Check if the input value is a file.
📄️ Float
Check if the input value is a float number.
📄️ Image
Check if the input value is a file and the file type is an image.
📄️ In
Check if the input value is in a given array.
📄️ Int
Check if the input value is an integer.
📄️ Length
Check if the input value length equal to the given length.
📄️ Localized
Check if the input value is a localized value.
📄️ Max Length
Check if the input value length is less than or equal to the given length.
📄️ Max
Check if the input value is less than or equal to the given maximum value.
📄️ Min Length
Check if the input value length is greater than or equal to the given length.
📄️ Min
Check if the input value is greater than or equal to the given minimum value.
📄️ Missing If
The input must be not present or empty if another input is equal to the given value.
📄️ Number
Check if the input value is a number either an integer or a float.
📄️ Object
Check if the input value is an object.
📄️ Pattern
Check if the input value matches a given pattern.
📄️ Required With
The input under validation must be present and not empty only if any of the other specified fields are present.
📄️ Required If
Check if the input value is not empty if another input has a specific value.
📄️ Required With All
The input under validation must be present and not empty only if all of the other specified fields are present.
📄️ Required If Empty
The input must be present and not empty if another input is empty.
📄️ Required
Check if the input value is not empty.
📄️ Scalar
Check if the input value is a scalar value.
📄️ String
Check if the input value is a string.
📄️ Stringify
Check if the input value is a string or a number.
📄️ Unique
Check if the input value is unique in the database.
📄️ Uploadable
Check if the input value is a hash of Uploadable.
📄️ Url
Check if the input value is a valid url
📄️ Create Your Own Rule
To create a new rule, you need to create a class that extends the Rule class.