Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Dedicated method for password validation rules. #16060

Merged
merged 1 commit into from
Oct 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/Illuminate/Foundation/Auth/ResetsPasswords.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public function showResetForm(Request $request, $token = null)
*/
public function reset(Request $request)
{
$this->validate($request, [
'token' => 'required', 'email' => 'required|email',
'password' => 'required|confirmed|min:6',
]);
$this->validate($request, $this->getResetValidationRules());

// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
Expand All @@ -57,6 +54,19 @@ public function reset(Request $request)
: $this->sendResetFailedResponse($request, $response);
}

/**
* Get the password reset validation rules.
*
* @return array
*/
protected function getResetValidationRules()
{
return [
'token' => 'required', 'email' => 'required|email',
'password' => 'required|confirmed|min:6',
];
}

/**
* Get the password reset credentials from the request.
*
Expand Down