The Prophet ﷺ saw expectoration in the direction of the Qibla of the mosque while he was leading the prayer, and scratched it off. After finishing the prayer, he said, "Whenever any of you is in prayer he should know that Allah is in front of him. So none should spit in front of him in the prayer."
أَنَّهُ قَالَ رَأَى النَّبِيُّ ﷺ نُخَامَةً فِي قِبْلَةِ الْمَسْجِدِ وَهْوَ يُصَلِّي بَيْنَ يَدَىِ النَّاسِ فَحَتَّهَا ثُمَّ قَالَ حِينَ انْصَرَفَ إِنَّ أَحَدَكُمْ إِذَا كَانَ فِي الصَّلاَةِ فَإِنَّ اللَّهَ قِبَلَ وَجْهِهِ فَلاَ يَتَنَخَّمَنَّ أَحَدٌ قِبَلَ وَجْهِهِ فِي الصَّلاَةِ رَوَاهُ مُوسَى بْنُ عُقْبَةَ وَابْنُ أَبِي رَوَّادٍ عَنْ نَافِعٍ