Answers for "validation password laravel"

PHP
10

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

Laravel Password Validation

'password' => 'required|
               min:6|
               regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[dx])(?=.*[!$#%]).*$/|
               confirmed',
Posted by: Guest on August-14-2021
0

laravel validate change password

<?php
   
namespace AppHttpControllers;
   
use IlluminateHttpRequest;
use AppRulesMatchOldPassword;
use IlluminateSupportFacadesHash;
use AppUser;
  
class ChangePasswordController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }
   
    /**
     * Show the application dashboard.
     *
     * @return IlluminateContractsSupportRenderable
     */
    public function index()
    {
        return view('changePassword');
    } 
   
    /**
     * Show the application dashboard.
     *
     * @return IlluminateContractsSupportRenderable
     */
    public function store(Request $request)
    {
        $request->validate([
            'current_password' => ['required', new MatchOldPassword],
            'new_password' => ['required'],
            'new_confirm_password' => ['same:new_password'],
        ]);
   
        User::find(auth()->user()->id)->update(['password'=> Hash::make($request->new_password)]);
   
        dd('Password change successfully.');
    }
}
Posted by: Guest on January-07-2022

Code answers related to "validation password laravel"

Browse Popular Code Answers by Language