Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfaramarzi committed Jul 2, 2021
1 parent 38ae99b commit 9dc0b2f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/Validation/Rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,22 @@ private function checkDB(array $parameters): bool

protected function exists(array $parameters): void
{
$check = $this->checkDB($parameters);
if ($this->request->input($parameters['ruleName'])){
$check = $this->checkDB($parameters);

if ($this->request->input($parameters['ruleName']) && ! $check)
array_push($this->messages , $parameters['message']);
if (! $check)
array_push($this->messages , $parameters['message']);
}
}

protected function unique(array $parameters): void
{
$check = $this->checkDB($parameters);
if ($this->request->input($parameters['ruleName'])){
$check = $this->checkDB($parameters);

if ($this->request->input($parameters['ruleName']) && $check)
array_push($this->messages , $parameters['message']);
if ($this->request->input($parameters['ruleName']) && $check)
array_push($this->messages , $parameters['message']);
}
}


Expand Down

0 comments on commit 9dc0b2f

Please sign in to comment.