laravel/framework — pull request #4227 by JamShady (2014-04-22 13:52:55+00:00)
Title: Pivot updates recorded only if something updated

The sync() method currently returns ids for all attached models when an update is made if they have attributes to update also - regardless of whether an update actually took place.

This fix ensures that only those pivot records that actually got updated are returned, as not to include false positives.