To improve the accuracy of the quantitative analysis of heavy metals in pig feed by laser-induced breakdown spectroscopy (LIBS), the Cu element in common pig feed in the market is taken as the research object, and a quantitative analysis model of the Cu element in pig feed is established by the partial least square (PLS) method, combining spatial confinement to improve LIBS signal intensity and quantitative model accuracy. The diameter and height of the spatial confinement cavity used in the experiment are 4. 5 and 2 mm, respectively. Nine smooth, standard normal variable transformation, multiplicative scatter correction, and other methods are used to perform spectral preprocessing on the LIBS spectra of 60 groups of pig feed samples and build a PLS prediction model. The results show that, based on the cylindrical cavity confinement, using nine smooth combined with multiplicative scatter correction preprocessing has the best effect. Without spatial confinement, the correlation coefficient of the prediction set (R) is 0. 8684, the root mean square error of prediction set (RMSEP) is 49. 3, and the average relative error of the prediction set (ARE) is 43. 95%. With spatial confinement, the R is 0. 9881, the RMSEP is 14. 4, and the ARE is 12. 51%. The research results show that the addition of spatial confinement to LIBS technology can significantly improve the spectral signal intensity of the Cu element in pig feed and the accuracy of the PLS model. It provides better support for the precise safety inspection of pig feed.