-1

How can i override this text on laravel, when validation fails I've searching this text all over project but didn't find also

Farid
  • 23
  • 1
  • 4
  • please check this https://stackoverflow.com/questions/45007905/custom-laravel-validation-messages – Kamlesh Paul Sep 03 '20 at 11:28
  • Welcome to SO ... i bet if you searched for "must be at least" you will find them in the validation lang file. – lagbox Sep 03 '20 at 11:28
  • https://github.com/laravel/laravel/blob/2c69ec987e2dca71008684fc80bbe56c55427dc3/resources/lang/en/validation.php#L87 – Jerodev Sep 03 '20 at 11:35
  • This is a form validation error right? If so why not just tweak the rule at where the validation is handled from `min:8` to whatever, or remove it entirely? – tsommie Sep 03 '20 at 11:45
  • This might answer your question: https://stackoverflow.com/questions/57253476/unwanted-validation-rule-being-applied-on-password-reset/57254666#57254666 – Rwd Sep 03 '20 at 12:06

1 Answers1

0

If you have a min:8 rule for the password field, we can create a custom message.

e.g: $rules = [
                 'password' => 'min:8|required'
               ];
     $messages = [
                   'password.min' => 'your custom message',
                   'password.required' => 'your custom message'
                  ];
     $isValid = Validator::make($requestInputs, $rules, $messages);
Dharman
  • 30,962
  • 25
  • 85
  • 135
Jayant
  • 280
  • 2
  • 6