Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit c970e60

Browse files
authored
fix: password length requirements (#5)
1 parent 8ecf5fd commit c970e60

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Rules/Password.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function passes($attribute, $value)
4040
return false;
4141
}
4242

43-
return $this->needsMinimumLength($value);
43+
return ! $this->needsMinimumLength($value);
4444
}
4545

4646
/**
@@ -118,7 +118,7 @@ public function requireLowercase()
118118

119119
public function needsLowercase(string $value): bool
120120
{
121-
if (! $this->requireUppercase) {
121+
if (! $this->requireLowercase) {
122122
return false;
123123
}
124124

@@ -127,7 +127,7 @@ public function needsLowercase(string $value): bool
127127

128128
public function needsUppercase(string $value): bool
129129
{
130-
if (! $this->requireLowercase) {
130+
if (! $this->requireUppercase) {
131131
return false;
132132
}
133133

@@ -154,6 +154,6 @@ public function needsSpecialCharacter(string $value): bool
154154

155155
public function needsMinimumLength(string $value): bool
156156
{
157-
return ! (Str::length($value) >= $this->length);
157+
return Str::length($value) < $this->length;
158158
}
159159
}

0 commit comments

Comments
 (0)