An egui app I wrote which simulates a laser using simple photon particles. Note that it won't handle the wavelike phenomena like coherence and resonance as it is a purely particle based simulation.
It simulates the two three and four level configurations, with some explanatory text and animations. Play with it here!