laravel/framework — pull request #2809 by anlutro (2013-11-26 23:25:58+00:00)
Title: Fixes for relationships and checkboxes #2548

Unfortunately this is an issue that's spread over many parts of Laravel. First, the form builder wasn't always telling the truth on whether or not it had old session input. Second, object_get wasn't working well with numeric segments and arrays/collections (for example `object_get($obj, 'relation.2')`). Third, Eloquent collections don't index by model key when being fetched from the database, so you can't do a simple array lookup.

This is a dirty as all hell fix for issue #2548, but seems to work and no unit tests are breaking. You'll have to do `Form::checkbox("relation[$relation->id")` and `array_keys(Input::get('relation'))` to get an array of keys which you can then use to sync the relations.