Did God command Abraham to sacrifice his son? Or, as some Muslims argue, did Abraham have a vision or dream inspired by Satan to kill his son? These Muslims argue that God would never order a crime such as this as supported by Sura 7:28, when the Qura'n says God would never advocate sin. Instead they say, God saved Abraham from killing his son when he saw the extent of Abraham's belief in God. Which is it?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
The dream of the Messengers and Prophets, may Allaah exalt their mention, is a sort of revelation as stated in the sound Hadeeth because they are protected from being represented by Satan. Allah indicated in the Quran that Abraham saw in a dream that he would slaughter his son. Then Abraham acted according to what he saw, as he was sure that it was a revelation from Allah.
Allah Says (what means): {And [then] he said, “Indeed, I will go to [where I am ordered by] my Lord; He will guide me. My Lord, grant me [a child] from among the righteous.” So We gave him good tidings of a forbearing boy. And when he reached with him [the age of] exertion, he said, “O my son, indeed I have seen in a dream that I [must] sacrifice you, so see what you think.” He said, “O my father, do as you are commanded. You will find me, if Allah wills, of the steadfast.”} [Quran 37:99-102]
This dream was a test and a trial from Allah to His Messenger and friend Abraham and it is a great test indeed. But Abraham succeeded in this test. Allah Says that Abraham believed in that dream and acted according to it. So Allah rewarded him as He rewards the well-doers.
Therefore, what Abraham saw was a revelation and he had to abide by it. As a result, Allah praised him. This is what the majority of Muslims believe. On the other hand, this is not an order from Allah to commit sins. Allah is far above that.
Allah knows best.
You can search for fatwa through many choices