translations and attribute names

This commit is contained in:
spencerrlongg
2024-11-14 11:42:35 -06:00
parent 8c6869fd34
commit 95cd779334
3 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -18,9 +18,10 @@ class NumericEncrypted implements ValidationRule
{
try {
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
$decrypted = Crypt::decrypt($value);
if (!is_numeric($decrypted) && !is_null($decrypted)) {
$fail($attribute.' is not numeric.');
$fail(trans('validation.custom.numeric_encrypted', ['attribute' => $attributeName]));
}
} catch (\Exception $e) {
report($e->getMessage());