laravel/framework — pull request #3003 by adamwathan (2013-12-20 03:17:57+00:00)
Title: Added support for syncing a collection of models instead of just IDs

Currently with a belongsToMany relationship, you can only `sync` an array of IDs, but can `attach` a model OR ID.

Other relationships in Laravel tend to use a model when inserting (`$user->posts()->save($post)` rather than `$user->posts()->save(1)`) so it seemed in the interest of consistency to allow passing a collection of models to sync on a belongsToMany relationship in addition to just passing an array of IDs.