Welcome to the forum.
Volkswagon beetles had the flat 4 design first then they expanded their engines to fit their Porsche sibling line that needed flat 6's,
German engineering copied by the Japanese. Subaru's have flat 4 and flat 6 engines. Ferrari had a flat 12 at one time.