Skip to content

Commit

Permalink
resolveFlash($this) call before $this->callback($closure)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamedevelopers committed Jan 19, 2024
1 parent ed43de7 commit c63d0be
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ public function validate($closure = null)
$this->isValidatedCalled = true;

if($this->hasError()){
$this->callback($closure);

// save into a remembering variable
ValidatorMethod::resolveFlash($this);

$this->callback($closure);
}

return $this;
Expand All @@ -124,11 +125,12 @@ public function validate($closure = null)
public function save($closure)
{
if($this->isValidated()){
$this->callback($closure);


// save into a remembering variable
ValidatorMethod::resolveFlash($this);


$this->callback($closure);

// delete csrf session token
CsrfToken::unsetToken();
}
Expand Down

0 comments on commit c63d0be

Please sign in to comment.