Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols.

  Рет қаралды 6,865

Laratips

Laratips

Күн бұрын

Пікірлер: 14
@Laratips
@Laratips 3 жыл бұрын
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.Mwangi
@Samuel.Mwangi 3 жыл бұрын
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.
@Laratips
@Laratips 3 жыл бұрын
Yup, I agree.
@kishoreprasaanth2477
@kishoreprasaanth2477 10 ай бұрын
Thankyou for helping to solve this. Using regex lead to an issue when I used some symbols. This helped us a lot.
@keshavthakur5990
@keshavthakur5990 3 жыл бұрын
Very nice explaining validation, Thanks.
@pwcodigo
@pwcodigo Жыл бұрын
Excelente conteúdo, muito obrigado !
@webmaker1845
@webmaker1845 2 жыл бұрын
Super sir thanks ☺️☺️
@Sub-lb7uq
@Sub-lb7uq Жыл бұрын
Thanks for the video, is it possible to add something like Password::min(8)->letters()->numbers()->mixedCase()->symbols()
@pacykarz2009
@pacykarz2009 3 жыл бұрын
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
@Laratips
@Laratips 3 жыл бұрын
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.
@pacykarz2009
@pacykarz2009 3 жыл бұрын
@@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 :)
@Laratips
@Laratips 3 жыл бұрын
Haha. Its the only way now. Or you can send a pull request to Laravel or raise an issue 😁
@novocanal7153
@novocanal7153 2 жыл бұрын
Not working 😞
@Laratips
@Laratips 2 жыл бұрын
I should work. For more details you can check the Laravel's official documentation.
Refactor If else Statements Using Polymorphism -  Part 3
13:52
Laratips
Рет қаралды 2,8 М.
5 Laravel Relationship Tips That You Might Not Know About
8:21
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 6 МЛН
Faster Eloquent: Avoid Accessors with Foreach
9:35
Laravel Daily
Рет қаралды 54 М.
3 Different Ways To Get Authenticated User In Laravel
4:07
Laratips
Рет қаралды 12 М.
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,6 МЛН
Laravel Tip - Format Multilevel Categories With Single Query
8:02
Google Data Center 360° Tour
8:29
Google Cloud Tech
Рет қаралды 5 МЛН
Laravel Eloquent: Deeper Relationships with One Query
10:37
Laravel Daily
Рет қаралды 144 М.
Difference between cookies, session and tokens
11:53
Valentin Despa
Рет қаралды 663 М.
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 6 МЛН