Previous owner dug a trench right behind the garage to install some pipes as a landscaping drainage solution, but never filled the trench back in after the job was completed. As a result, the bottom of the concrete slab under the garage has been exposed on that side and between regular rain/snow/erosion the gap has presumably grown over time and I just became aware of it recently. There are a couple small cracks that have formed and each extend a few inches into the slab from the top.
The gap between the bottom of the concrete slab and the soil below it is a couple inches tall, but not very deep, going back only 3-4 inches in some areas, and probably 6-8 inches in the worst parts. This isn't to say it's a 2 inch gap going all the way back, just that tall at the very edge of the slab.
I'm thinking I need to fill that gap with something and then after that is done shovel the dirt back into this trench so that it's back to the level it was at before the trench was dug.
I can't seem to find this sort of case discussed elsewhere, but what I am finding is a discussion of much larger voids under concrete where expanding polyurethane form is recommended. Should I still be leaning towards expanding foam as a solution, given the small area to be filled (prior to replacing the dirt to build the ground back up to the level it should be at) I question if just squirting it in around the edges like this would even provide significantly more structural support than packing in cement or any other filler material? Or am I overthinking this whole thing and should just use dirt?