The mid-2012 MacBook Pro was the last with an optical drive, and it is finally considered obsolete by Apple.
mid-2012 13-inch MacBook Pro
Apple maintains a vintage and obsolete product list that updates based on how long it has been since a product was for sale. Some vintage products may be eligible for service, while obsolete products are not.
The addition of the mid-2012 MacBook Pro was first discovered by Ars Technica. It is the most recent addition since The iPhone SE and 12.9-inch iPad Pro joined the vintage list in December.
Devices in the vintage list haven't been for sale for at least five years. Obsolete products haven't been for sale for seven years.
Some regions like France have special requirements for products sold. Owners of iPhones or Macs purchased in 2021 or later can obtain service and parts from Apple or service providers for seven years after the date the product model was last supplied by Apple.
Obsolete products lose their ability to be serviced with one exception. MacBooks may be eligible for an extended battery-only repair period for up to 10 years from when the product was last distributed for sale.
The optical drive was ditched amidst the Jony Ive era of ever encroaching thinness. An external optical drive called the SuperDrive is still available, but connects over USB-A and is a relic itself.