confirm password validation in laravel

PHP
'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.$this->validate($request, [
    'name' => 'required|min:3|max:50',
    'email' => 'email',
    'vat_number' => 'max:13',
    'password' => 'required|confirmed|min:6',
]);1. $user = User::where('email', request('email'))->first();
2. Hash::check(request('password'), $user->password);

This will return true or false based on whether or not the password matches.
Source

Also in PHP: