DEV Community

Morcos Gad
Morcos Gad

Posted on

Laravel Password Validation - Arr::whereNotNull() method

Let's get started quickly with Password Validation here to make Password more powerful

$request->validate([
 'password' => ['required','confirmed', Rules\Password::defaults()->mixedCase()->min(12)],
])
Enter fullscreen mode Exit fullscreen mode

You can enforce specific rules when validating user-supplied passwords by using the method. It includes options for requiring letters, numbers, symbols, and more :-
Password::defaults

Arr::whereNotNull() method which filters out null values from an array:

Arr::whereNotNull([null, 0, false, '', null, []]);
// returns [0, false, '', []]
Enter fullscreen mode Exit fullscreen mode

Source :- https://www.youtube.com/watch?v=_TlQPp-dG1k
Source :- https://laravel-news.com/laravel-8-75-0
I hope you enjoyed the code.

Top comments (0)