Full Idea
Skeptics may doubt the truth of things, and if it pleases them to call the things that occur to us dreams, it suffices for these dreams to be in agreement with each other, and to obey certain laws.
Gist of Idea
If we are dreaming, it is sufficient that the events are coherent, and obey laws
Source
Gottfried Leibniz (On Perceptions [1680], A6.4.1398), quoted by Daniel Garber - Leibniz:Body,Substance,Monad 7
Book Reference
Garber,Daniel: 'Leibniz: Body, Substance, Monad' [OUP 2009], p.280
A Reaction
Leibniz flirted a great deal with phenomenalism throughout the middle of his career, as charted by Garber. Descartes made similar points. It is really only Berkeley who took this idea seriously.