IDIOMS

as luck would have it

(idiomatic) As it happened; how it turned out; by good fortune; fortunately or luckily.

Example:   I didn't plan to stop there, but as luck would have it, they were open when I went by.