A bug in the way iOS 12 handles charging that causes devices to not charge when connected to a power source is on its way to being rectified, with a beta release of iOS 12.1 fixing the problem on iPhones and iPads affected by the issue.
Source:: Apple Insider