Does iPhone 5 charger work for iPhone 6
There are only 2 types of connector for iPhones/Pads; the old-style 30-pin &amp; the new-style Lightning connector. The change to Lightning, for phones, is at iPhone 5; prior to that they were 30-pin.

The output of a phone/pad charger has only 2 variations, 1A for phones, 2A for pads. Any device needing 2A or less will work on a 2A charger, a 2A device on a 1A charger will charge, but very slowly.

Any recent Apple computer is capable of charging either a pad or phone directly over USB, using the detachable cable from a mains charger, as Apple incorporated a non-standard 2A capability into the ports. Older machines can charge phones easily, but pads only more slowly, as they don't have the full 2A capability.

However, there is no compatibility between a phone/pad charger &amp; a laptop charger, without 3rd party hardware. Examples - https://www.twelvesouth.com/product/plugbug or http://www.supercompressor.com/tech/cabin-charges-your-iphone-with-a-macbook-charger
A phone charger cannot be pressed into service for a laptop, as it's not powerful enough.

So…
TL:DR is yes, it will work, so long as you're charging the phone from the laptop over USB, or directly from a phone/pad charger.
As you'd need to have the phone connected to the laptop over USB for connectivity, just using the USB->Lightning connector is sufficient.

If it fits, it works.