Try installing a ps4/ds4 driver on your pc, and in the device settings check if the middle ‘PS’ button is working. Could be a faulty ribbon. It also happened to me out of the blue.
Try to install a ps4 controller driver on your pc and attach the controller via usb. And then in the device settings check if the other buttons are working. What happened to me before is that the ‘ middle PS button’ was busted so it wont turn on and I thought it was dead. And it appears to be not charging because the battery was already full. If that’s the case, just replace the ribbon inside (it’s pretty cheap and easy to do).
In my case (model G1010), i pushed the cartridge to the right side. And on the far left side found a small piece of paper (toll ticket) stuck in the gears. I didn’t see it before because the cartridge was blocking the view. It fixed the issue for me.