According to the Hanafi school, the prayer and wudu are invalidated if one laughs out loud during a prayer containing bowing and prostration. The conditions for this are:
1. One is an adult
2. One is awake
3. One’s laughter is out loud
[Mawsuli, al-Ikhtiyar]
Possible Scenarios
There are three possible situations which could occur:
a. Loud laughing: Laughter with a raised sound such that under normal circumstances, the person praying next to one would be able to hear it (even if they do not hear it or there is nobody around)
The Ruling: If done by an adult, who is awake, in a prayer containing bowing and prostration, it invalidates the ritual ablution and the prayer.
Therefore the ritual ablution of a child, a sleeping person and a person praying the funeral prayer or performing the prostration of recital will not be invalidated by loud laughter.
b. Laughing: Laughter such that under normal circumstances one would be able to hear it however, the person praying next to one would not be able to hear it
The Ruling: this invalidates the prayer only
c. Smiling: One cannot hear it
The Ruling: this has no effect on the validity of the prayer.
[Shurunbulali, Maraqi’l Falah]
And Allah knows best.