use existing validation strings

This commit is contained in:
spencerrlongg 2024-11-19 08:59:47 -06:00
parent 124f9c84c2
commit 22602c7997
3 changed files with 2 additions and 4 deletions

View file

@ -19,7 +19,7 @@ class AlphaEncrypted implements ValidationRule
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
$decrypted = Crypt::decrypt($value);
if (!ctype_alpha($decrypted) && !is_null($decrypted)) {
$fail(trans('validation.custom.alpha_encrypted', ['attribute' => $attributeName]));
$fail(trans('validation.alpha', ['attribute' => $attributeName]));
}
} catch (\Exception $e) {
report($e);

View file

@ -21,7 +21,7 @@ class NumericEncrypted implements ValidationRule
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
$decrypted = Crypt::decrypt($value);
if (!is_numeric($decrypted) && !is_null($decrypted)) {
$fail(trans('validation.custom.numeric_encrypted', ['attribute' => $attributeName]));
$fail(trans('validation.numeric', ['attribute' => $attributeName]));
}
} catch (\Exception $e) {
report($e->getMessage());

View file

@ -187,8 +187,6 @@ return [
'custom' => [
'alpha_space' => 'The :attribute field contains a character that is not allowed.',
'alpha_encrypted' => 'The :attribute field should be alphabetic characters.',
'numeric_encrypted' => 'The :attribute field should be numeric characters.',
'email_array' => 'One or more email addresses is invalid.',
'hashed_pass' => 'Your current password is incorrect',
'dumbpwd' => 'That password is too common.',