It should be enough to do:
$this->validate($request, [
'password' => 'sometimes,min:6,confirmed,required_with:password_confirmed',
]);
Make password optional, but if present requires a password_confirmation that matches, also make password required only if password_confirmed is present