The Prophet ﷺ said, "Whoever slaughters before the prayer must repeat it." The hadith continues.
عن النبي ﷺ قال: من ذبح قبل الصلاة فليعد الحديث.
Bukhari narrated it in the Chapter on Sacrifices (5561), and Muslim narrated it in the Chapter on Sacrifices (1962), both from the hadith of Ismail bin Ibrahim (he is Ibn Ulaya), from Ayub, from Muhammad (he is Ibn Sirin), from Anas, who mentioned it.