From 5aa035934cfc97358a4c231719f78290a54aae06 Mon Sep 17 00:00:00 2001 From: David Gvritishvili Date: Sun, 3 Apr 2016 17:11:34 +0400 Subject: [PATCH] Add messages and custom attributes to the password reset validation --- .../Foundation/Auth/ResetsPasswords.php | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Auth/ResetsPasswords.php b/src/Illuminate/Foundation/Auth/ResetsPasswords.php index e9fa70ac23b..5bf5e135851 100644 --- a/src/Illuminate/Foundation/Auth/ResetsPasswords.php +++ b/src/Illuminate/Foundation/Auth/ResetsPasswords.php @@ -181,7 +181,12 @@ public function postReset(Request $request) */ public function reset(Request $request) { - $this->validate($request, $this->getResetValidationRules()); + $this->validate( + $request, + $this->getResetValidationRules(), + $this->getResetValidationMessages(), + $this->getResetValidationCustomAttributes() + ); $credentials = $request->only( 'email', 'password', 'password_confirmation', 'token' @@ -216,6 +221,26 @@ protected function getResetValidationRules() ]; } + /** + * Get the password reset validation messages. + * + * @return array + */ + protected function getResetValidationMessages() + { + return []; + } + + /** + * Get the password reset validation custom attributes. + * + * @return array + */ + protected function getResetValidationCustomAttributes() + { + return []; + } + /** * Reset the given user's password. *