You can capture M31 with any size instrument, from camera and lenses to small to middle size telescopes. But be mindful as its size projected on the sky is about 6 moon diameters, so larger aperture telescopes are not recommended if you want to capture the whole galaxy.
I took this image at my Stardust Observatory using a Meade 80mm refractor with a focal reducer and Canon 6D Mark11 full frame camera, 30x3 minute exposures with ISO2500. 20x3 minute darks and flats were also captured and stacked in DSS and processed in PS.
For more information on this amazing stellar object please go to the links below:
https://lowell.edu/views-from-mars-hill-andromeda-galaxy/
https://www.nasa.gov/image-article/galaxy-next-door/
https://www.iau.org/public/themes/constellations/