From 22602c7997a98764ebb8b6473adc95d22d5d3569 Mon Sep 17 00:00:00 2001 From: spencerrlongg Date: Tue, 19 Nov 2024 08:59:47 -0600 Subject: [PATCH] use existing validation strings --- app/Rules/AlphaEncrypted.php | 2 +- app/Rules/NumericEncrypted.php | 2 +- resources/lang/en-US/validation.php | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Rules/AlphaEncrypted.php b/app/Rules/AlphaEncrypted.php index b39a5fedb..f4ed1d6c3 100644 --- a/app/Rules/AlphaEncrypted.php +++ b/app/Rules/AlphaEncrypted.php @@ -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); diff --git a/app/Rules/NumericEncrypted.php b/app/Rules/NumericEncrypted.php index 4121ce517..f3cb3ba76 100644 --- a/app/Rules/NumericEncrypted.php +++ b/app/Rules/NumericEncrypted.php @@ -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()); diff --git a/resources/lang/en-US/validation.php b/resources/lang/en-US/validation.php index d054c8b43..7d7840eb4 100644 --- a/resources/lang/en-US/validation.php +++ b/resources/lang/en-US/validation.php @@ -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.',