Broken business model-
For phones, and most of the "smart/IoT" gadgets on the market.
If you sell a device that relies on external resources (cloud/web services for IoTs to operate, OS/security updates for all devices) you should either:
A: Include a sensible sum in the purchase price that is then escrowed to fund X years of support for those resources (where X is at least 5, preferably 10)
B: Only sell a subscription-based model where regular payments are made for the use of the device (mobile operators in the UK please note: you are basically doing this but washing your hands of the "ongoing support" bit).
You will sell fewer devices. But you will keep the customers you have, and have a recurring revenue stream from them.
As for who does it best in the current free-for-all, I'd vote for Apple. As a household we have three Macs, ranging in age from 7 to 13 years, a 9 year old iPad and a 5 year old iPhone. Out of that lot, only the older two Macs (10 and 13 years) are not able to run the current OS, but even those still have decent security and are entirely usable for most day to day tasks. And out of all that lot, we've had one replacement HDD and one replacement battery.
Of course, Apples current crop may fall down on the "hardware fixability" front, but I don't think they are alone.
I have a Samsung S8. Prior to that had two HTCs, neither lasted more than 2 years (the hardware - and I am gentle with it). The Samsung is now 3-1/2. The battery is down to about 85%, but that can be replaced. It does everything I want and will only be replaced when it ceases to do so.
In my local government work I've recently been issued with an M$ Surface. It doesn't even work properly out of the box! And my experience of Windows laptops is that they never survive more than 2-3 years. Hardware is ropey (I'm talking HP, Dell here, not no-names) and software is often unusable. One honourable exception from way back: Thinkpads pre-Lenovo. Designed to be repairable, and brilliantly supported. But that was when IBM still made computers--.
It's been noted that "smart" domestic appliances are a trojan horse, in that your lovely new fridge may suddenly stop working after a couple of years when the manufacturer pulls support. I will be very interested to see what happens to long term support for (EG) Tesla vehicles, although I think they are doing OK so far, they've been around ten years now and the old ones still seem to work!