Hey friend,
I got the gnats this recent time around too..and after trying a few remedies like neem and hydrogen peroxide sprays and them not fully going away I had a friend recommend a different approach.
At the hardware store or garden store they sell mosquito bits...they're little pellets or round pucks. I put those in each pot and they've slowly killed away any larva as they get watered and dissolve. Then i used a squirt bottle with water + Dr. Bonner's soap to kill the last flying ones.
You could also do stick traps for the flying ones...but those are a bit costly.
Good luck with the battle.✌️