To encode a password in symfony, we have to use UserPasswordEncoderInterface to encode the password. It will need to pass the User entity as first parameter for the method encodePassword().
It will be cool if we could do something like
$config->registerMapping(UserDto::class, User::class)
->forMember("password", function($source, $destination) use ($passwordEncoder) {
return $passwordEncoder->encodePassword($destination, $source->password);
});
To encode a password in symfony, we have to use
UserPasswordEncoderInterfaceto encode the password. It will need to pass the User entity as first parameter for the methodencodePassword().It will be cool if we could do something like