Answers for "laravel password validations"

PHP
12

confirm password validation laravel

'password' => 'required|confirmed',

reference : https://laravel.com/docs/4.2/validation#rule-confirmed

The field under validation must have a matching field of foo_confirmation. 
For example, if the field under validation is password, a matching
password_confirmation field must be present in the input.
Posted by: Guest on August-02-2020
1

password validation rules laravel

// Laravel 8+

// Require at least 8 characters...
Password::min(8)

// Require at least one letter...
Password::min(8)->letters()

// Require at least one uppercase and one lowercase letter...
Password::min(8)->mixedCase()

// Require at least one number...
Password::min(8)->numbers()

// Require at least one symbol...
Password::min(8)->symbols()
  
// Or you can chain them all
use Illuminate\Validation\Rules\Password;

$rules = [
    'password' => [
        'required',
        'string',
        Password::min(8)
            ->mixedCase()
            ->numbers()
            ->symbols()
            ->uncompromised(),
        'confirmed'
    ],
]
Posted by: Guest on December-21-2021

Code answers related to "laravel password validations"

Browse Popular Code Answers by Language