use existing validation strings
This commit is contained in:
parent
124f9c84c2
commit
22602c7997
3 changed files with 2 additions and 4 deletions
|
@ -19,7 +19,7 @@ class AlphaEncrypted implements ValidationRule
|
||||||
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
|
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
|
||||||
$decrypted = Crypt::decrypt($value);
|
$decrypted = Crypt::decrypt($value);
|
||||||
if (!ctype_alpha($decrypted) && !is_null($decrypted)) {
|
if (!ctype_alpha($decrypted) && !is_null($decrypted)) {
|
||||||
$fail(trans('validation.custom.alpha_encrypted', ['attribute' => $attributeName]));
|
$fail(trans('validation.alpha', ['attribute' => $attributeName]));
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
report($e);
|
report($e);
|
||||||
|
|
|
@ -21,7 +21,7 @@ class NumericEncrypted implements ValidationRule
|
||||||
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
|
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
|
||||||
$decrypted = Crypt::decrypt($value);
|
$decrypted = Crypt::decrypt($value);
|
||||||
if (!is_numeric($decrypted) && !is_null($decrypted)) {
|
if (!is_numeric($decrypted) && !is_null($decrypted)) {
|
||||||
$fail(trans('validation.custom.numeric_encrypted', ['attribute' => $attributeName]));
|
$fail(trans('validation.numeric', ['attribute' => $attributeName]));
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
report($e->getMessage());
|
report($e->getMessage());
|
||||||
|
|
|
@ -187,8 +187,6 @@ return [
|
||||||
|
|
||||||
'custom' => [
|
'custom' => [
|
||||||
'alpha_space' => 'The :attribute field contains a character that is not allowed.',
|
'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.',
|
'email_array' => 'One or more email addresses is invalid.',
|
||||||
'hashed_pass' => 'Your current password is incorrect',
|
'hashed_pass' => 'Your current password is incorrect',
|
||||||
'dumbpwd' => 'That password is too common.',
|
'dumbpwd' => 'That password is too common.',
|
||||||
|
|
Loading…
Add table
Reference in a new issue