1. Try a charger from the laptop maker that is for this laptop.
2. If that fails the usual is a new motherboard.
3. If you have a good technician have them pull the board and put in a new power connector on the motherboard. These do fail for some and there's an entire industry for laptop power jack repair.
-> If it's working now, why this discussion?
Though the problem is solved I want to know if there's a reason it happened. The other day my charger broke, it wasn't the original and it fact it was a universal one with adaptable voltage. I bought another charger online this time one for my PC (Asus Aspire E14) but When I plugged it in it wouldn't charge( I tried this several times with each charger I bought), this actually happened with 3 chargers and fortunately I returned them and got my money back, except for one that the site let me keep since it didn't work(they returned my money of course) . I was super frustrated because I thought something was definitely wrong with my laptop and tried plugging in it in once more with the charger I kept, it didn't work but I didn't unplug it because I forgot and then next day I saw it was fully charged, and now it's charging normally.