My phone was showing something like; connected with the OTG cable, go to settings and disconnect OTG, meanwhile OTG cable isn't connected.
That's what it showed before it stopped charging
Which laptop brand and model and phone/android version is it?
Do you mean, that your laptop will only charge your phone while the laptop is on? Have a look at the USB ports of your laptop, the ones with a flash symbol or similar should be on while the laptop is off.
like the right USB port in this picture: https://cloud.addictivetips.com/wp-content/uploads/2016/05/usb-port-1.jpg