From 5d5eb5096fefef3af7d77366d727c17448cdee25 Mon Sep 17 00:00:00 2001 From: iamfarhad Date: Mon, 27 Feb 2023 21:21:47 +0000 Subject: [PATCH] Fix styling --- src/Rules/NationalCode.php | 1 + tests/Rules/UsernameTest.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rules/NationalCode.php b/src/Rules/NationalCode.php index 5e146d7..34b8a3a 100644 --- a/src/Rules/NationalCode.php +++ b/src/Rules/NationalCode.php @@ -31,6 +31,7 @@ public function passes($attribute, $value): bool } $control = ($sub % 11) < 2 ? $sub % 11 : 11 - ($sub % 11); + return $value[9] == $control; } diff --git a/tests/Rules/UsernameTest.php b/tests/Rules/UsernameTest.php index f3a6f50..f53a2d3 100644 --- a/tests/Rules/UsernameTest.php +++ b/tests/Rules/UsernameTest.php @@ -2,7 +2,6 @@ namespace Iamfarhad\Validation\Tests\Rules; -use Iamfarhad\Validation\Rules\Address; use Iamfarhad\Validation\Rules\Username; use Iamfarhad\Validation\Tests\TestCase; use Illuminate\Support\Facades\Validator;