I had the same problem with cattle entering the barn Eddie. I tried gravel wood chips more dirt, a lot more,even landscape timbers, nothing lasted very long, and the problem came right back.
This is the best solution I finally came up with. I removed all the mud as soon as the weather improved, then improved drainage a bit with drain pipe. I had access to a supply of broken up concrete chunks from an old driveway tear out, on top of that, I used 2 inch drain rock, and then some driveway gravel to fill the voids. I used railroad ties to contain all ‘tis, so it would’t Migrate away.
A lot of work, but mostly tractor work, which I enjoy. It wasn’t a perfect solution, but it lasted a long time by cattle slop standards
And finally, my 100% solution was to get out of the farm animal business, and grow wine grapes, which has it’s own issues, but no vet bills or manure shoveling to deal with.