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 `Rakit\Validation\Rule` class). By default `fillParameters` will fill parameters listed in `$fillable_params`. For example `unique:users,email,exception@mail.com` 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 `DG\Validation\Rule` class). By default `fillParameters` will fill parameters listed in `$fillable_params`. For example `unique:users,email,exception@mail.com` in example above, will set:
1006
1008
1007
1009
```php
1008
1010
$params['table'] = 'users';
@@ -1029,7 +1031,7 @@ So you can improve `UniqueRule` class above by adding some methods that returnin
1029
1031
```php
1030
1032
<?php
1031
1033
1032
-
use Rakit\Validation\Rule;
1034
+
use DG\Validation\Rule;
1033
1035
1034
1036
class UniqueRule extends Rule
1035
1037
{
@@ -1078,7 +1080,7 @@ To make your custom rule implicit, you can make `$implicit` property value to be
1078
1080
```php
1079
1081
<?php
1080
1082
1081
-
use Rakit\Validation\Rule;
1083
+
use DG\Validation\Rule;
1082
1084
1083
1085
class YourCustomRule extends Rule
1084
1086
{
@@ -1092,15 +1094,15 @@ class YourCustomRule extends Rule
1092
1094
1093
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.
1094
1096
1095
-
To do this, you should implements `Rakit\Validation\Rules\Interfaces\ModifyValue` and create method `modifyValue($value)` to your custom rule class.
1097
+
To do this, you should implements `DG\Validation\Rules\Interfaces\ModifyValue` and create method `modifyValue($value)` to your custom rule class.
1096
1098
1097
1099
For example:
1098
1100
1099
1101
```php
1100
1102
<?php
1101
1103
1102
-
use Rakit\Validation\Rule;
1103
-
use Rakit\Validation\Rules\Interfaces\ModifyValue;
1104
+
use DG\Validation\Rule;
1105
+
use DG\Validation\Rules\Interfaces\ModifyValue;
1104
1106
1105
1107
class YourCustomRule extends Rule implements ModifyValue
1106
1108
{
@@ -1121,24 +1123,24 @@ class YourCustomRule extends Rule implements ModifyValue
1121
1123
1122
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.
1123
1125
1124
-
To do this, you should implements `Rakit\Validation\Rules\Interfaces\BeforeValidate` and create method `beforeValidate()` to your custom rule class.
1126
+
To do this, you should implements `DG\Validation\Rules\Interfaces\BeforeValidate` and create method `beforeValidate()` to your custom rule class.
1125
1127
1126
1128
For example:
1127
1129
1128
1130
```php
1129
1131
<?php
1130
1132
1131
-
use Rakit\Validation\Rule;
1132
-
use Rakit\Validation\Rules\Interfaces\BeforeValidate;
1133
+
use DG\Validation\Rule;
1134
+
use DG\Validation\Rules\Interfaces\BeforeValidate;
1133
1135
1134
1136
class YourCustomRule extends Rule implements BeforeValidate
0 commit comments