Skip to content

Validation: How to customize localization messages in Password rules? #41915

Closed Answered by Nielson
pronist asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @pronist

I was just struggling with this as well. I found the answer in this post: https://www.magutti.com/blog/laravel-8-password-rule.

You have to create a .json file like "en.json" or whatever your localization is, in your lang folder.

Eg:

/resources
    /lang
        it.json
        es.json
        en.json

This must contain the following:

{
    "The :attribute must contain at least one uppercase and one lowercase letter.": "Your translation",
    "The :attribute must contain at least one letter.": "Your translation",
    "The :attribute must contain at least one symbol.": "Your translation"
}

I hope this helps :)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@mariankustusch
Comment options

Answer selected by pronist
Comment options

You must be logged in to vote
1 reply
@Kamandlou
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants