  We consider a two-dimensional electron gas interacting with a quantized
cavity mode. We find that the coupling between the electrons and the photons in
the cavity enhances the superconducting gap. Crucially, all terms in the
Peierls phase are kept, in contrast to more naive approaches, which may result
in spurious superradiant phase transitions. We use a mean-field theory to show
that the gap increases approximately linearly with the cavity coupling
strength. The effect can be observed locally as an increase in the gap size via
scanning tunneling microscopy (STM) measurements for a flake of a 2D material
(or for a Moir\'e system where the enhancement is expected to be more
pronounced due to a large lattice constant) interacting with a
locally-structured electromagnetic field formed by split-ring resonators. Our
results are also relevant for quantum optics setups with cold atoms interacting
with the cavity mode, where the lattice geometry and system parameters can be
tuned in a vast range.
