From c970e6049a887bb8f6c0d2c5a2440f5148730759 Mon Sep 17 00:00:00 2001 From: Brian Faust Date: Wed, 21 Oct 2020 17:10:28 +0300 Subject: [PATCH] fix: password length requirements (#5) --- src/Rules/Password.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Rules/Password.php b/src/Rules/Password.php index 9067a231..0991d9b9 100644 --- a/src/Rules/Password.php +++ b/src/Rules/Password.php @@ -40,7 +40,7 @@ public function passes($attribute, $value) return false; } - return $this->needsMinimumLength($value); + return ! $this->needsMinimumLength($value); } /** @@ -118,7 +118,7 @@ public function requireLowercase() public function needsLowercase(string $value): bool { - if (! $this->requireUppercase) { + if (! $this->requireLowercase) { return false; } @@ -127,7 +127,7 @@ public function needsLowercase(string $value): bool public function needsUppercase(string $value): bool { - if (! $this->requireLowercase) { + if (! $this->requireUppercase) { return false; } @@ -154,6 +154,6 @@ public function needsSpecialCharacter(string $value): bool public function needsMinimumLength(string $value): bool { - return ! (Str::length($value) >= $this->length); + return Str::length($value) < $this->length; } }