While digging through the earth to excavate the well of Zam Zam, ‘Abdul Muttalib had nobody to assist him besides his only son, Haarith. He therefore took an oath that if Allah Ta‘ala blessed him with ten sons, who would grow up to be his helping hands; he would slaughter one of them in the name of Allah Ta‘ala.
One night, after Allah Ta‘ala had fulfilled this desire by granting him ten sons, he was fast asleep in front of the Ka‘bah when he saw a person in a dream instructing him:
يا عبد المطلب أوف بنذرك لرب هذا البيت
“O ‘Abdul Muttalib! Fulfil your vow that you had pledged for the Lord of this sacred house.”
On awakening from this dream, ‘Abdul Muttalib summoned all his sons and revealed his vow and subsequent dream to them. They all submitted in one voice:
أوف بنذرك وافعل ما شئت
“Fulfil your vow and do as you please.”
(Extracted from Seeratul Mustafa 1/37)