Skip to content

Commit 22602c7

Browse files
committed
use existing validation strings
1 parent 124f9c8 commit 22602c7

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

app/Rules/AlphaEncrypted.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
1919
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
2020
$decrypted = Crypt::decrypt($value);
2121
if (!ctype_alpha($decrypted) && !is_null($decrypted)) {
22-
$fail(trans('validation.custom.alpha_encrypted', ['attribute' => $attributeName]));
22+
$fail(trans('validation.alpha', ['attribute' => $attributeName]));
2323
}
2424
} catch (\Exception $e) {
2525
report($e);

app/Rules/NumericEncrypted.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
2121
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
2222
$decrypted = Crypt::decrypt($value);
2323
if (!is_numeric($decrypted) && !is_null($decrypted)) {
24-
$fail(trans('validation.custom.numeric_encrypted', ['attribute' => $attributeName]));
24+
$fail(trans('validation.numeric', ['attribute' => $attributeName]));
2525
}
2626
} catch (\Exception $e) {
2727
report($e->getMessage());

resources/lang/en-US/validation.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@
187187

188188
'custom' => [
189189
'alpha_space' => 'The :attribute field contains a character that is not allowed.',
190-
'alpha_encrypted' => 'The :attribute field should be alphabetic characters.',
191-
'numeric_encrypted' => 'The :attribute field should be numeric characters.',
192190
'email_array' => 'One or more email addresses is invalid.',
193191
'hashed_pass' => 'Your current password is incorrect',
194192
'dumbpwd' => 'That password is too common.',

0 commit comments

Comments
 (0)