パスワードリセット時 6桁じゃなくて 4桁にしたい。
ResetsPasswordController.php
protected function rules()
{
return [
'token' => 'required',
'email' => 'required|email',
'password' => 'required|string|min:4|confirmed',
];
}
これを追記しないとデフォルトのやつ使っちゃってControllerの設定がうまくいかない。
必ず追加。
web.php
Route::match(['get', 'post'] , '/password/reset/{token}', 'Auth\ResetPasswordController@reset');
Route::match(['get', 'post'] , '/password/reset/', 'Auth\ResetPasswordController@reset');
しかし、
Passwords must be at least six characters and match the confirmation.
が出るのでこっちも変更
PasswordBroker.php 168行目らへん
protected function validatePasswordWithDefaults(array $credentials)
{
list($password, $confirm) = [
$credentials['password'],
$credentials['password_confirmation'],
];
return $password === $confirm && mb_strlen($password) >= 4;
}