“aturan validasi kata sandi laravel” Kode Jawaban

Validasi kata sandi Laravel

'password' => 'required|
               min:6|
               regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\d\x])(?=.*[!$#%]).*$/|
               confirmed',
Sleepy Salmon

aturan validasi kata sandi 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'
    ],
]
Obedient Okapi

validasi kata sandi Laravel

use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rules\Password;

$validator = Validator::make($request->all(), [
    'password' => ['required', 'confirmed', Password::min(8)],
]);
Silly Sardine

Jawaban yang mirip dengan “aturan validasi kata sandi laravel”

Pertanyaan yang mirip dengan “aturan validasi kata sandi laravel”

Lebih banyak jawaban terkait untuk “aturan validasi kata sandi laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya