  We consider optical systems where propagation of light can be described by a
Dirac-like equation with $PT$-symmetric Hamiltonian. In order to construct
exactly solvable configurations, we extend the confluent Crum-Darboux
transformation for the one-dimensional Dirac equation. The properties of the
associated intertwining operators are discussed and the explicit form for
higher-order transformations is presented. We utilize the results to derive a
multi-parametric class of exactly solvable systems where the balanced gain and
loss represented by the $PT$-symmetric refractive index can imply localization
of the electric field in the material.
