You can also append one more rule on this Password validation class called 'uncompromised' and it will validate whether it has appeared in data leak or not.
@Samuel.Mwangi3 жыл бұрын
In my opinion, uncompromised() is the only rule I will be using going forward. If the password is not compromised yet, it is more secure than most mixed character combinations a user can come up with plus provides for a better UX. If they use the same password on every site they sign up for, it's only a matter of time before the password is unavailable to use.
@Laratips3 жыл бұрын
Yup, I agree.
@kishoreprasaanth247710 ай бұрын
Thankyou for helping to solve this. Using regex lead to an issue when I used some symbols. This helped us a lot.
@keshavthakur59903 жыл бұрын
Very nice explaining validation, Thanks.
@pwcodigo Жыл бұрын
Excelente conteúdo, muito obrigado !
@webmaker18452 жыл бұрын
Super sir thanks ☺️☺️
@Sub-lb7uq Жыл бұрын
Thanks for the video, is it possible to add something like Password::min(8)->letters()->numbers()->mixedCase()->symbols()
@pacykarz20093 жыл бұрын
What are the keys for the new validation rules to create your own error messages in UserRequest in the function messages(), e.g. for a different language
@Laratips3 жыл бұрын
I looked into the source code and found that it is using Laravel's __() helper method under the hood. So you can do it like sho: Create en.json file in resources/lang directory and add this code for the english language (This is optional. Just to show that these are the supported messages) { "The :attribute must contain at least one number.": "The :attribute must contain at least one numbers.", "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", "The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute." } And if you want to create for another language the create another json file on the same directory (E.g. es.json for Spanish) then modify it like so, { "The :attribute must contain at least one number.": "La contraseña debe contener al menos un número.", // ..... and others } On the right hand side of the json value, you can replace :attribute with password of the specific language like I have done here.
@pacykarz20093 жыл бұрын
@@Laratips Until now, in the xx.json file I keep the translations of messages used in many blade views, and the specific error messages of the entered data in the appropriate Request files for the Model. I will have to break this rule for UserRequest :)
@Laratips3 жыл бұрын
Haha. Its the only way now. Or you can send a pull request to Laravel or raise an issue 😁
@novocanal71532 жыл бұрын
Not working 😞
@Laratips2 жыл бұрын
I should work. For more details you can check the Laravel's official documentation.