The best fox repellents use ultrasound, repelling scents or waterjets.
Give ultrasonic repellers a few weeks to deter the foxes, initially fox may see the repeller as an enemy that needs to be challenged, when they realize they cannot win they will keep away for good.
Granules are a cheap solution but of course you need to keep buying more to keep the foxes away. Eventually you will have spent far more than if you bought an ultrasonic repeller.
Water jet sprayer models are another option, cheaper than the ultrasonic repellers but less effective and harder to install and maintain because of the hose pipe attachment. You and your pets also risk being sprayed as you pass by them. Water jet sprayers typically have a range of 1 to 3m depending on your hose pipe water pressure.