DEV Community

Morcos Gad
Morcos Gad

Posted on

3 1

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)

👋 Kindness is contagious

Dive into this thoughtful article, cherished within the supportive DEV Community. Coders of every background are encouraged to share and grow our collective expertise.

A genuine "thank you" can brighten someone’s day—drop your appreciation in the comments below!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found value here? A quick thank you to the author makes a big difference.

Okay