We investigated hole (Cd)- and electron (Sn)-doped ${\mathrm{CeCoIn}}_{5}$ [$\mathrm{CeCo}{({\mathrm{In}}_{1\ensuremath{-}x}{T}_{x})}_{5}$ ($T=\mathrm{Cd}$ or Sn)] using infrared spectroscopy. Doping-dependent hybridization-gap distribution functions were obtained from the optical conductivity spectra based on the periodic Anderson model formalism. The hybridization-gap distribution exhibits two components: in-plane and out-of-plane hybridization gaps. The doping-dependent evolution of the two gaps indicated that the out-of-plane gap was more sensitive to doping. Furthermore, the magnetic optical resistivity exhibited a doping-dependent evolution of the $f$-electron amplitude. The two dopant types exhibited different physical properties depending on the level of doping. The Sn dopant increases the $f$-electron amplitude, whereas the Cd dopant does not affect the $f$-electron amplitude. Doping-dependent effective mass is peaked at pure (or undoped) ${\mathrm{CeCoIn}}_{5}$. Our spectroscopic results may help understand the doping-dependent electronic evolution of one of the canonical heavy-fermion systems, ${\mathrm{CeCoIn}}_{5}$.