iPhone 6 and iPhone 7
Both devices have a 12-megapixel camera. This ensures that both devices capture beautiful photos and videos. The camera aperture of the iPhone 7 is lower, improving the light intake. This means you can take better photos in dark environments with the iPhone 7. Additionally, the 'selfie camera' of the iPhone 7 has also been improved. The device has a 7-megapixel camera compared to the 5-megapixel camera of the iPhone 6S.

iPhone 7 and iPhone 8
The iPhone 7 and the iPhone 8 both have a 12-megapixel camera. Apple has improved the aperture on the iPhone 8 by enlarging the camera sensor. The pixel technology and optical image stabilization have also been improved on the iPhone 8, allowing you to take sharper photos.
iPhone X and iPhone 11 and iPhone 11 Pro
As a camera, the iPhone 11 Pro (Max) is the best choice. You retain the same wide-angle lens but get an improved telephoto lens and a new ultra-wide-angle lens. This means you can not only zoom in better optically but also take wider photos by zooming out further. There are also more options for portrait mode, and depth control has been added. If you choose the iPhone 11, keep in mind that it is a step back. Although this model has a dual camera, they are different lenses than those on the iPhone X. The iPhone X has a wide-angle and telephoto lens, while the iPhone 11 has a wide and ultra-wide-angle lens. This means you lose the ability to zoom in optically. If you use this feature a lot, you might want to choose the iPhone 11 Pro instead.
Consider a refurbished iPhone
The flagship of Apple, the iPhone 11 Pro or Max, has the best specifications regarding the camera. There is also a price for this. If you choose a refurbished iPhone, then the iPhone 8 or iPhone X is an excellent choice. You will have a great camera for half the (recommended) price.