{"action":"created","issue":{"url":"https://api.github.com/repos/LaravelCollective/html/issues/46","repository_url":"https://api.github.com/repos/LaravelCollective/html","labels_url":"https://api.github.com/repos/LaravelCollective/html/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/LaravelCollective/html/issues/46/comments","events_url":"https://api.github.com/repos/LaravelCollective/html/issues/46/events","html_url":"https://github.com/LaravelCollective/html/pull/46","id":85910732,"number":46,"title":"Allow collection as selected parameter for dropdowns","user":{"login":"cgrossde","id":2333584,"avatar_url":"https://avatars.githubusercontent.com/u/2333584?v=3","gravatar_id":"","url":"https://api.github.com/users/cgrossde","html_url":"https://github.com/cgrossde","followers_url":"https://api.github.com/users/cgrossde/followers","following_url":"https://api.github.com/users/cgrossde/following{/other_user}","gists_url":"https://api.github.com/users/cgrossde/gists{/gist_id}","starred_url":"https://api.github.com/users/cgrossde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgrossde/subscriptions","organizations_url":"https://api.github.com/users/cgrossde/orgs","repos_url":"https://api.github.com/users/cgrossde/repos","events_url":"https://api.github.com/users/cgrossde/events{/privacy}","received_events_url":"https://api.github.com/users/cgrossde/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2015-06-07T15:15:47Z","updated_at":"2016-09-14T14:13:57Z","closed_at":"2015-08-31T17:01:44Z","pull_request":{"url":"https://api.github.com/repos/LaravelCollective/html/pulls/46","html_url":"https://github.com/LaravelCollective/html/pull/46","diff_url":"https://github.com/LaravelCollective/html/pull/46.diff","patch_url":"https://github.com/LaravelCollective/html/pull/46.patch"},"body":"If you have a dropdown which allows to select multiple options then you can also pass multiple defaults:\r\n\r\n```\r\n{!! Form::select('roles', $roleArray, $user->roles->lists('id'), [ 'id' => 'roles', 'multiple' => 'multiple', 'name' => 'roles[]' ]); !!}\r\n```\r\n\r\nProblem is that `$user->roles->lists('id')` returns a collection. I could add `->all()` to get an array but it would be nice to do this automatically in LaravelCollective/html.\r\n\r\nThis pull request adds a simple conversion if `$selected` of the `select()` method is a collection.\r\n"},"comment":{"url":"https://api.github.com/repos/LaravelCollective/html/issues/comments/247026413","html_url":"https://github.com/LaravelCollective/html/pull/46#issuecomment-247026413","issue_url":"https://api.github.com/repos/LaravelCollective/html/issues/46","id":247026413,"user":{"login":"Decadence","id":1434668,"avatar_url":"https://avatars.githubusercontent.com/u/1434668?v=3","gravatar_id":"","url":"https://api.github.com/users/Decadence","html_url":"https://github.com/Decadence","followers_url":"https://api.github.com/users/Decadence/followers","following_url":"https://api.github.com/users/Decadence/following{/other_user}","gists_url":"https://api.github.com/users/Decadence/gists{/gist_id}","starred_url":"https://api.github.com/users/Decadence/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Decadence/subscriptions","organizations_url":"https://api.github.com/users/Decadence/orgs","repos_url":"https://api.github.com/users/Decadence/repos","events_url":"https://api.github.com/users/Decadence/events{/privacy}","received_events_url":"https://api.github.com/users/Decadence/received_events","type":"User","site_admin":false},"created_at":"2016-09-14T14:13:57Z","updated_at":"2016-09-14T14:13:57Z","body":"Actually I would be nice if multiple select work as checkbox in case of Belongs To Many relationship.\r\n\r\n```php\r\nelseif ($posted instanceof Collection) {\r\n      return $posted->contains('id', $value);\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"Decadence"}}