Password & Password_Confirmation Validation in laravel

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Password & Password_Confirmation Validation in laravel

Hi Dev’s, Today now in this example, I will share with you how to give password and password_confirmation validation in laravel application. So we can simply do this by using to validation in laravel application.

So we want to match given password and also confirm password by using this validation. Now we will check password and password_confirmation then we need to use below solution.

Solution :-

/**
* The attributes that are mass assignable.
*
* @var array
*/
public function store(Request $request)
{
    $input = $request->all();

    $validator = $request->validate([
            'email' => 'email',
            'vat_number' => 'max:13',
            'password' => 'required|confirmed|min:6',
	]);

    // Write Logic
}

Read also : How To Set Bcc And Cc Mail Address In Laravel Mail?

I hope it will help you. Also you can follow us on Facebook

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →