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; } }