The Prophet ﷺ said, "Whoever slaughters before the prayer has only slaughtered for himself, and whoever slaughters after the prayer has completed his sacrificial rite and has followed the practice of the Muslims."
قال النبي ﷺ: من ذبح قبل الصلاة فإنما ذبح لنفسه، ومن ذبح بعد الصلاة فقد تم نسكه، وأصاب سنة المسلمين.
Bukhari narrated it in the Book of Sacrifices (5546) from Musaddad, who said, Ismail narrated to us, from Ayub, from Muhammad (that is, Ibn Sirin), from Anas, and he related it.Muslim narrated it in the Book of Sacrifices (10:1962) through several routes from Ismail bin Ibrahim (that is, Ibn Ulaya), with the same chain, at greater length and with different wording.