I have used in this way. Its Working fine!
$rules = [
'password' => [
'required',
'string',
'min:6',
'max:12', // must be at least 8 characters in length
],
'confirm_password' => 'required|same:password|min:6'
];