You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In `UniqueRule` above, property `$message` is used for default invalid message. And property `$fillable_params` is used for `fillParameters` method (defined in `DG\Validation\Rule` class). By default `fillParameters` will fill parameters listed in `$fillable_params`. For example `unique:users,email,[email protected]` in example above, will set:
1007
+
In `UniqueRule` above, property `$message` is used for default invalid message. And property `$fillable_params` is used for `fillParameters` method (defined in `IgniteKit\Validation\Rule` class). By default `fillParameters` will fill parameters listed in `$fillable_params`. For example `unique:users,email,[email protected]` in example above, will set:
1008
1008
1009
1009
```php
1010
1010
$params['table'] = 'users';
@@ -1031,7 +1031,7 @@ So you can improve `UniqueRule` class above by adding some methods that returnin
1031
1031
```php
1032
1032
<?php
1033
1033
1034
-
use DG\Validation\Rule;
1034
+
use IgniteKit\Validation\Rule;
1035
1035
1036
1036
class UniqueRule extends Rule
1037
1037
{
@@ -1080,7 +1080,7 @@ To make your custom rule implicit, you can make `$implicit` property value to be
1080
1080
```php
1081
1081
<?php
1082
1082
1083
-
use DG\Validation\Rule;
1083
+
use IgniteKit\Validation\Rule;
1084
1084
1085
1085
class YourCustomRule extends Rule
1086
1086
{
@@ -1094,15 +1094,15 @@ class YourCustomRule extends Rule
1094
1094
1095
1095
In some case, you may want your custom rule to be able to modify it's attribute value like our `default/defaults` rule. So in current and next rules checks, your modified value will be used.
1096
1096
1097
-
To do this, you should implements `DG\Validation\Rules\Interfaces\ModifyValue` and create method `modifyValue($value)` to your custom rule class.
1097
+
To do this, you should implements `IgniteKit\Validation\Rules\Interfaces\ModifyValue` and create method `modifyValue($value)` to your custom rule class.
1098
1098
1099
1099
For example:
1100
1100
1101
1101
```php
1102
1102
<?php
1103
1103
1104
-
use DG\Validation\Rule;
1105
-
use DG\Validation\Rules\Interfaces\ModifyValue;
1104
+
use IgniteKit\Validation\Rule;
1105
+
use IgniteKit\Validation\Rules\Interfaces\ModifyValue;
1106
1106
1107
1107
class YourCustomRule extends Rule implements ModifyValue
1108
1108
{
@@ -1123,24 +1123,24 @@ class YourCustomRule extends Rule implements ModifyValue
1123
1123
1124
1124
You may want to do some preparation before validation running. For example our `uploaded_file` rule will resolves attribute value that come from `$_FILES` (undesirable) array structure to be well-organized array structure, so we can validate multiple file upload just like validating other data.
1125
1125
1126
-
To do this, you should implements `DG\Validation\Rules\Interfaces\BeforeValidate` and create method `beforeValidate()` to your custom rule class.
1126
+
To do this, you should implements `IgniteKit\Validation\Rules\Interfaces\BeforeValidate` and create method `beforeValidate()` to your custom rule class.
1127
1127
1128
1128
For example:
1129
1129
1130
1130
```php
1131
1131
<?php
1132
1132
1133
-
use DG\Validation\Rule;
1134
-
use DG\Validation\Rules\Interfaces\BeforeValidate;
1133
+
use IgniteKit\Validation\Rule;
1134
+
use IgniteKit\Validation\Rules\Interfaces\BeforeValidate;
1135
1135
1136
1136
class YourCustomRule extends Rule implements BeforeValidate
0 commit comments