0
Laravelの正式な足場でパスワードをリセットするためのデフォルトの検証を無効にするにはどうすればよいですか?Laravel 5.4:リセットパスワードの有効化をカスタマイズできません
私はResetsPasswordsトレイトから、私のResetPasswordControllerに、以下の方法コピーした:私は、例えば、ルールを削除すると
public function reset(Request $request)
{
$this->validate($request, $this->rules(), $this->validationErrorMessages());
// 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
// database. Otherwise we will parse the error and return the response.
$response = $this->broker()->reset(
$this->credentials($request), function ($user, $password) {
$this->resetPassword($user, $password);
}
);
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
return $response == Password::PASSWORD_RESET
? $this->sendResetResponse($response)
: $this->sendResetFailedResponse($request, $response);
}
/**
* Get the password reset validation rules.
*
* @return array
*/
protected function rules()
{
return [
'token' => 'required',
'email' => 'required|email',
'password' => 'required|confirmed|min:6',
];
}
を長さが6文字未満のパスワードを使用すると、 'min:6'エラーメッセージが返されます。
私は関連するドキュメントに言及しましたが、私はそれから必要なものを取ることができませんでした。
お手数をおかけしますようお願い申し上げます。
:あなたはあなたが使用することができ、右ルート を使用していることを確認:ここ
たちは
Auth\ResetPasswordController
NBにフルコントロールを持つことができますので、のは、直接
Validator
クラスを使用してみましょう、別の方法です、 ご協力いただきありがとうございます。私は上記をテストして、フォームはまだ私が削除したバリデーションルールからエラーを返すようですが、応答変数がこの原因であるようです。 –