Summarize this text:

Muhammad prayed in seclusion every year during the month of Ramadan. In 610 he began to have visions during his spiritual retreat, and in a cave a voice told him three times to recite. As he was walking down the mountain, the voice identified itself as the angel Gabriel. These recitations were later written down as the Qur'an. The first to accept the new religion of Islam were his wife and two sons, and they were called Muslims, which means those who submit to God. Muhammad shared his revelations with those present. He was ordered to pray and established the regular times for prayer. The Quraysh tribe tried to stop his growing following with persecution and boycotts. A group of 82 Muslims migrated to Abyssinia. Muhammad's wife Khadija died in 619. Then when Abu Talib died, the prophet's clan lost some of their protection; Muhammad himself even had to take refuge in an orchard. In spirit Muhammad traveled at night from Mecca to Jerusalem, and Moses urged them to pray fifty times a day; but Muhammad got it reduced to five times a day. Muslims began migrating to Medina. In 622 Muhammad was warned of an assassination plot; he hid and then migrated to Medina.

Muhammad began receiving visions and revelations during his spiritual retreats in a cave, which were eventually compiled into the Qur'an. His family were the first to accept Islam, and they were known as Muslims. Muhammad faced persecution from the Quraysh tribe and ultimately had to flee to Medina in 622 after being warned of an assassination plot.