seems to work just fine now, needs translations

This commit is contained in:
spencerrlongg
2024-11-13 21:54:25 -06:00
parent 25163d1756
commit 7e7cbc4cc8
2 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -16,13 +16,15 @@ class NumericEncrypted implements ValidationRule
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
try {
$value = Crypt::decrypt($value);
if (!is_numeric($value)) {
$decrypted = Crypt::decrypt($value);
if (!is_numeric($decrypted) && !is_null($decrypted)) {
$fail($attribute.' is not numeric.');
}
} catch (\Exception $e) {
$fail($e->getMessage());
report($e->getMessage());
$fail('something went wrong');
}
}
}