Skip to content

Commit 46168ab

Browse files
committed
Update readme
1 parent ae3a47b commit 46168ab

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,18 +475,51 @@ The field under this rule must have a size greater or equal than the given numbe
475475

476476
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.
477477

478+
You can also validate uploaded file using this rule to validate minimum size of uploaded file.
479+
For example:
480+
481+
```php
482+
$validation = $validator->validate([
483+
'photo' => $_FILES['photo']
484+
], [
485+
'photo' => 'required|min:1M'
486+
]);
487+
```
488+
478489
<a id="rule-max"></a>
479490
#### max:number
480491

481492
The field under this rule must have a size lower or equal than the given number.
482493
Value size calculated in same way like `min` rule.
483494

495+
You can also validate uploaded file using this rule to validate maximum size of uploaded file.
496+
For example:
497+
498+
```php
499+
$validation = $validator->validate([
500+
'photo' => $_FILES['photo']
501+
], [
502+
'photo' => 'required|max:2M'
503+
]);
504+
```
505+
484506
<a id="rule-between"></a>
485507
#### between:min,max
486508

487509
The field under this rule must have a size between min and max params.
488510
Value size calculated in same way like `min` and `max` rule.
489511

512+
You can also validate uploaded file using this rule to validate size of uploaded file.
513+
For example:
514+
515+
```php
516+
$validation = $validator->validate([
517+
'photo' => $_FILES['photo']
518+
], [
519+
'photo' => 'required|between:1M,2M'
520+
]);
521+
```
522+
490523
<a id="rule-digits"></a>
491524
#### digits:value
492525

0 commit comments

Comments
 (0)