Skip to content

Commit 45a48d8

Browse files
committed
update readme
1 parent 0616030 commit 45a48d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ $model->clearSupersedingValidationRules();
215215
$model->validate(); // Validation will occur normally.
216216
```
217217
#### Mixin Rules
218-
You can use the `setMixinValidationRules()` method to set rules that will be **merged** with the other rules defined on the model. The rules you define for a particular attribute will replace any existing rules for that attribute.
218+
You can use the `addMixinValidationRules()` and `setMixinValidationRules()` methods to define rules that will be **merged** with the other rules defined on the model. The rules you mixin for a particular attribute will replace any existing rules for that attribute.
219219

220220
For example, suppose your model specifies that a dateTime column must simply be a `date` by default, but for a particular situation, you want to ensure that the attribute's value is a date _after a particular moment_. You can do this by mixing in this custom ruleset for this attribute at runtime.
221221

@@ -230,7 +230,7 @@ $mixinRules = [
230230
'date_attribute' => ['date', 'after:tomorrow']
231231
];
232232

233-
$model->setMixinValidationRules($mixinRules);
233+
$model->addMixinValidationRules($mixinRules);
234234

235235
$model->validate(); // The validator will use a *combination* of the mixin rules and the standard rules defined within the model.
236236

0 commit comments

Comments
 (0)