The cost of setting up an efficient minefield in space would probably be prohibitive.
Mining a certain strip of sea or land is possible because in terms of coverage you are dealing with a 2D surface and the environment lends itself to concealment (burying the device on land, and submerging it at sea).
The issue in space is that
a) you are dealing with a 3D volume so coverage is exponentially more expensive (which is only compounded by the fact there isn't exactly an abundance of natural obstacles in space that would reliably make ships favor a certain route rather than another)
b) the device has to have to ability conceal itself built in, most likely further increasing it's sophistication and cost, unless there is some sort of cheap stealth plating readily available in the starbase universe.
I agree the idea of space mines is very cool, however even if you can make a functional space mine, you're probably still better off putting your payloads in missiles or torpedoes instead.
In terms of passive area denial, some sort of automated turret or sleeper drone sounds more practical, save for the fact whatever code they are running is processing a single line every 2 seconds making target acquisition a challenge to say the least. Maybe with a simple "detect and fire" code and self-guided missiles it could work?