Abu Saeed Khudri reported,

The Prophet ﷺ noticed some phlegm on the wall facing the qiblah in the mosque and scraped it off with a pebble. He then forbade a person from spitting in front of himself or to his right, instructing instead that he spit to his left or beneath his left foot.

Azami 3122

Sahih

عن أبي سعيد

أن النبي ﷺ أبصر نخامة في قبلة المسجد، فحكها بحصاة، ثم نهى أن يبزق الرجل بين يديه أو عن يمينه، ولكن عن يساره، أو تحت قدمه اليسرى.

الأعظمي 3122صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Mosques
Section
Prohibition of spitting in the masjid and towards the qibla
Numbering
Jami al-Kamil 3122 (2nd edition)
Azami 3122