A man was allegedly slashed with a machete after he was approached by two men demanding his car keys.