Recognise a soap bubble in what way?
If you shone the laser at a light dependent resistor (LDR) you could tell when the beam changed - so if the only thing that might pass is a soap bubble that'd do.
If you wanted to spot a soap bubble instead of something else you'd have a bit more trouble.