Answers for "confirm password validation in laravel in new migration"

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
0

validate user password laravel8

$data = request()->validate([
        'firstname' => ['required', 'string', 'max:255'],
        'lastname' => ['required', 'string', 'max:255'],
        'username' => ['bail', 'nullable', 'string', 'max:255', 'unique:users'],
        'email' => ['bail', 'nullable', 'string', 'email:rfc,strict,dns,spoof,filter', 'max:255', 'unique:users'],
        'new_password' => ['nullable', 'string', 'min:8'],
        'confirm_new_password' => ['nullable', 'required_with:new_password', 'same:new_password'],
        'current_password' => ['required', function ($attribute, $value, $fail) {
            if (!\Hash::check($value, Auth::user()->password)) {
                return $fail(__('The current password is incorrect.'));
            }
        }]
    ]);
Posted by: Guest on October-07-2021

Code answers related to "confirm password validation in laravel in new migration"

Browse Popular Code Answers by Language