[Machine] The Messenger of Allah, ﷺ , stayed in Mecca for fifteen years: he could hear the voice and see the light for seven years, and for eight years he did not see anything but received revelations. He stayed in Medina for ten years, or according to the narration of Hajjaj ibn Minhal, seven years: he could see the light and hear the voice, and for eight years he received revelations.
أَقَامَ رَسُولُ اللهِ ﷺ بِمَكَّةَ خَمْسَ عَشْرَةَ سَنَةً يَسْمَعُ الصَّوْتَ وَيَرَى الضَّوْءَ سَبْعَ سِنِينَ وَلَا يَرَى شَيْئًا وَثَمَانِ سِنِينَ يُوحَى إِلَيْهِ وَأَقَامَ بِالْمَدِينَةِ عَشْرًا وَفِي رِوَايَةِ حَجَّاجِ بْنِ مِنْهَالٍ سَبْعًا يَرَى الضَّوْءَ وَيَسْمَعُ الصَّوْتَ وَثَمَانِيًا يُوحَى إِلَيْهِ وَأَقَامَ بِالْمَدِينَةِ عَشْرًا