We describe a method to numerically model flows through porous media by representing the porous medium as a randomly distributed collection of regularized Stokeslets. We establish a correspondence between our model and the Brinkman model description of porous media. The method provides a flexible way to treat porous media with complex geometries and deforming boundaries. We demonstrate it using examples of microscale swimmers.