Space is very big.
Supose that you want to put a minefield around an entire star system at a distance of three billion miles from the star.
No, the numbers involved in the calculations would be far too big if mere miles were used as the units.
Make the minefield have a radius of 30 Astronomical Units (AU), to make the numbers smaller and more maneagable. An AU is 149,597,870.7 kilometers or 92,955,807 miles.
According to a surface area calculator, the surface area of the spherical shell around the star system would be 11,309.7336 square AU. So if there are 11,310 mines, each mine would have a surface area of almost 1 square AU to itself. If the average place on the surface of the sphere was was about 0.5 AU from the nearest mine, the mines would have to be powerful enough to damage or totally destroy a space battleship at at distance of at least 0.5 AU, which is 74,798,935.35 kilometers or 46,477,903.5 miles.
What is the biggest explosion which we are familiar with? The constant explosion of the Sun. The Sun emits the energy of countless hydrogen bombs ever seceond. And yet humans hae sent space probes to the planet Venus, only 0.72 AU from the Sun, and to the planet Mercury, only 0.39 AU from the Sun.
Space probes have passed much closer to the constantly exploding Sun than that. On April 17, 1976 the Helios 2 space probe reached "a distance of 0.29 AU (about 27 million miles or 43.432 million kilometers)" from the Sun. Helio s 2 survived that close pasage to the Sun by years:
Helios 2’s downlink transmitter, however, failed March 3, 1980, and no further usable data was received from the spacecraft. Ground controllers shut down the spacecraft Jan. 7, 1981, to preclude any possible radio interference with other spacecraft in the future.
Parker Solar Probe now holds the record for closest approach to the Sun by a human-made object. The spacecraft passed the current record of 26.55 million miles from the Sun's surface on Oct. 29, 2018, at about 1:04 p.m. EDT, as calculated by the Parker Solar Probe team.
The previous record for closest solar approach was set by the German-American Helios 2 spacecraft in April 1976. As the Parker Solar Probe mission progresses, the spacecraft will repeatedly break its own records, with a final close approach of 3.83 million miles from the Sun's surface expected in 2024.
3.83 million miles is about 0.04120 Au. According to my rough calculations one AU would be about 24.27 times that distance. So one would need about 589 times 11,310 space mines, or 6,661,962 space mines each emitting as much energy in a second as the sun emits in a second, to deliver as much energy to the average spot on the surface of the sphere as the Parker Solar Probe is expected to experience and survive at its closest approach in 2024.
And the Parker Solar Probe will not merely experience that intensity of radiation for only one second, but will experience similar levels for a long time as it swings around the Sun.
So obviously your space mines will have to be built to deliver a much greater intensity of radiation at a distance of 0.04120 AU if they hope to disable a replica of the Parker Solar Probe. But presumably space battleships of the superadvanced cultures in the future would many times better protected against intense radiation than 21st century space probes.
So you will have to either make your mines explode with many times the energy that the Sun emits evry second, or else pack them much more densely in the shell around the star system, so that instead of mere millions, you will need "billions and billions" of space mines.
In Star Trek: Deep Space Nine:
An episode featured a mine field around a solar system. While this is much more plausible than mining a galaxy (in the way that swimming across Lake Erie is more plausible than swimming across the Pacific), they did it in a 2-D plane, so that anyone trying to avoid this minefield could simply fly over or under it. Even then, they were building it at a rate that would have taken them hundreds of years to complete. A later episode tackled the issue a bit more sensibly with a space minefield around a very small area (the opening of a wormhole) with a realistically long time spent laying it, using matter replicators to let it lay itself, but that gets into energy usage issues.
That plot element in the episode made the series seem more like BS9 than DS9.
In Blake's 7:
One scene showed someone laying mines around the Milky Way galaxy to keep out aliens. There are two ways to interpret this, neither of which is plausible:
One: It's meant literally and the entire galaxy is surrounded by mines. By the time you gathered enough matter to build this minefield, there'd be no Milky Way galaxy left.
Two: The mines aren't surrounding the entire galaxy, just on the likely invasion route. Of course this runs headlong into another trope as the alien invaders could just navigate around it.
What about building black hole mines with gravity strong enough to suck in any ship which tries to travel between? If the gravity of the black holes is so high, and the distance between them so small, that no ship can pass safely between them, the black holes will all move toward each other and merge into one giant black hole, which will leave a big gap in the minefield.