We have a fenced backyard, 5', and a fenced dog area at camp, 10x16, again 5'.
What I've done is lay a little concrete boundary along the fence edges, just a couple inches deep and wide, with the one at camp having a few small cutouts on the downslope side for drainage when we have spring floods. This has been enough to keep our multiple aussies from trying to dig out under the edge. With fast set concrete, pour into the little trench and soak it with a hose, get over 4' of linear coverage per bag.
I'm pretty sure I've also used regular concrete, cheaper, for this, again just pouring the dry stuff out of the bag and hosing it (put a little of the dirt on top of the wet concrete to improve curing). In theory you should mix regular concrete, then pour, but for this simple, non structural, use what I did still gets a rock-like edge.