Expand description
§Built-in Validation Rules
Provides common validation rules ready to use:
§Basic Type Validation
required()- Value must not be nullstring()- Value must be a stringinteger()- Value must be an integerfloat()- Value must be a floatboolean()- Value must be a booleanarray()- Value must be an arrayobject()- Value must be an object
§String Validation
length(n)- Exact lengthmin_length(n)- Minimum lengthmax_length(n)- Maximum lengthemail()- Valid email formaturl()- Valid URL formatip()- Valid IP addressregex()- Matches regex pattern
§Numeric Validation
min_value(n)- Minimum numeric valuemax_value(n)- Maximum numeric valueequal(n)- Exact value match
§Collection Validation
in_values()- Value must be in allowed setnot_in_values()- Value must not be in excluded set
§Database Validation
unique()- Field value must be unique in MongoDB collection
§Custom Validation
custom()- Implement custom validation logic
Structs§
- Rule
- Factory for creating validation rules