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

Commit

Permalink
fix: password length requirements (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian authored Oct 21, 2020
1 parent 8ecf5fd commit c970e60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Rules/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function passes($attribute, $value)
return false;
}

return $this->needsMinimumLength($value);
return ! $this->needsMinimumLength($value);
}

/**
Expand Down Expand Up @@ -118,7 +118,7 @@ public function requireLowercase()

public function needsLowercase(string $value): bool
{
if (! $this->requireUppercase) {
if (! $this->requireLowercase) {
return false;
}

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

public function needsUppercase(string $value): bool
{
if (! $this->requireLowercase) {
if (! $this->requireUppercase) {
return false;
}

Expand All @@ -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;
}
}

0 comments on commit c970e60

Please sign in to comment.