We had a feral cat problem in a duplex we rented years ago, so not a garden problem. We did the following and quickly they left our area alone.
1. Vinegar, poured on the foundation. They were using one area as a toilet, and spraying in one area. Yuk and stinky bc the smell was beginning to invade the basement. Cats do not like vinegar smell (per info we found on internet search “how to deter cats).
2. Remove all toilet areas, including top dirt around the areas.
3. Add mothballs under things (like bushes) where they want to hang out. Or any place you want to keep them away from. Some people say “OMG you’ll kill them with mothballs” but they avoid them, they don’t eat them. I think those people have never dealt with a cat problem or are anosmic (lacking sense of smell). I can attest that no cats died…they were all still alive and reproducing, just no longer affecting my little area.
My neighbors cat comes to my garden and buries a turd every once in awhile, so we shoo her away and scare her off when she’s in our yard/garden. We don't mind her, but we do mind her poops. Luckily she’s a huntress and stays in the farm field a lot, or at her barn, so not a constant issue. He now has 4 cats …. The huntress, a scaredy-cat that stays close to the barn, and now 2 kittens, so we may have more problems this year.