The electro-optical imaging system works under focus conditions for clear imaging. However, under unexpected laser irradiation, the focused light with extremely high intensity can easily damage the imaging sensor, resulting in permanent degradation of its perceptual capabilities. With the escalating prevalence of compact high-performance lasers, safeguarding cameras from laser damage presents a formidable challenge. Here, we report an end-to-end method to construct the wavefront coding (WFC) imaging systems with simultaneous superior laser protection and imaging performance. In the optical coding part, we employ four types of phase mask parameterization methods: pixel-wise, concentric rings, linear combinations of Zernike bases, and odd-order polynomial bases, with parameters that are learnable. In the algorithm decoding part, a method combined of deconvolution module and residual-Unet is proposed to furthest restore the phase-mask-induced image blurring. The optical and algorithm parts are jointly optimized within the end-to-end framework to determine the performance boundary. The governing rule of the laser protection capability versus imaging quality is revealed by tuning the optimization loss function, and the system database is established for various working conditions. Numerical simulations and experimental validations both demonstrate that the proposed laser-protection WFC imaging system can reduce the peak single-pixel laser power by 99.4% while maintaining high-quality imaging with peak signal-to-noise ratio more than 22 dB. This work pioneers what we believe to be a new path for the design of laser protection imaging systems, with promising applications in security and autonomous driving.