Cats are in your vegetable garden because they like it there. To keep the cats out, you have to make it uncomfortable for them. Cats like a surface to dig in when they defecate. The vegetable garden soil is likely to be loose and easy to dig in, so the cats use it. To keep cats out, put something on the ground to make it uncomfortable for them or include plants that they do not like. Alternatively, since you have to live with outdoor cats in your neighborhood, place a plant that cats like (catnip) in another area to lure them away from your garden.
Ways to Keep Cats Out of Your Vegetable Garden
Cats do not like water sprayed on them. If you can catch a cat in your garden and spray it with a garden hose or squirt gun, you will chase it away. This isn't a permanent deterrent, but there are motion activated senors that will activate a spray when you are not around.
Lay chicken wire or garden netting under your plants. Cats do not like to walk on surfaces that have wire mesh or any kind of edge on them. Placing this type of surface under the plants will not harm the garden or the cats, but it will deter the cat from digging and defecating there. A thick layer of pine bark mulch that is difficult for cats to dig in is good, too, and will keep the cats away.
Spread pepper or chili flakes in the cats' favorite areas. This may deter cats, but it is an eye irritant that can damage the cats' eyes and is dangerous for children who may play in or near the garden. A cat will get the chili pepper residue on its paws and then wash its face, transferring the irritant to its eyes. Pepper flakes are a temporary solution and must be reapplied every few days.
Catnip or cat mint planted in another area of your yard will attract the cats, and they might stay away from your vegetable garden. It is an attractive plant, easily controlled by pruning that will do no harm.
On the other side, Coleus canina (scaredy cat plant) is a plant that cats and other animals don't like.
Cats avoid lavender, but people like it and it can be planted among your vegetables to encourage friendly insects and bees.