Min and Max validators should compare numeric values when value is numeric, or file size when value is file. Laravel documentation:
The field under validation must have a size matching the given value. For string data, value corresponds to the number of characters. For numeric data, value corresponds to a given integer value. For an array, size corresponds to the count of the array. For files, size corresponds to the file size in kilobytes.
Package version
5.0.8
Node.js and npm version
node 10.15.3
npm 6.9.0
Sample Code (to reproduce the issue)
class Offset {
get validateAll() {
return true;
}
get sanitizationRules() {
return {
offset: 'to_int',
};
}
get rules() {
return {
offset: 'integer|min:1',
};
}
}
module.exports = Offset;
This example on data { offset: 0 } returns OK, but zero is below min value. Maybe this validators should check previous validators and then decide which type to use.
Min and Max validators should compare numeric values when value is numeric, or file size when value is file. Laravel documentation:
Package version
5.0.8
Node.js and npm version
node
10.15.3
npm6.9.0
Sample Code (to reproduce the issue)
This example on data
{ offset: 0 }
returns OK, but zero is below min value. Maybe this validators should check previous validators and then decide which type to use.