{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/scout/issues/146","repository_url":"https://api.github.com/repos/laravel/scout","labels_url":"https://api.github.com/repos/laravel/scout/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/laravel/scout/issues/146/comments","events_url":"https://api.github.com/repos/laravel/scout/issues/146/events","html_url":"https://github.com/laravel/scout/issues/146","id":196817977,"number":146,"title":"Wrong behaviour when body empty ","user":{"login":"duynguyenhoang","id":7106179,"avatar_url":"https://avatars.githubusercontent.com/u/7106179?v=3","gravatar_id":"","url":"https://api.github.com/users/duynguyenhoang","html_url":"https://github.com/duynguyenhoang","followers_url":"https://api.github.com/users/duynguyenhoang/followers","following_url":"https://api.github.com/users/duynguyenhoang/following{/other_user}","gists_url":"https://api.github.com/users/duynguyenhoang/gists{/gist_id}","starred_url":"https://api.github.com/users/duynguyenhoang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duynguyenhoang/subscriptions","organizations_url":"https://api.github.com/users/duynguyenhoang/orgs","repos_url":"https://api.github.com/users/duynguyenhoang/repos","events_url":"https://api.github.com/users/duynguyenhoang/events{/privacy}","received_events_url":"https://api.github.com/users/duynguyenhoang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-21T00:41:56Z","updated_at":"2016-12-21T00:41:56Z","closed_at":null,"body":"Hi, I have a problem below\r\n```\r\npublic function update($models)\r\n    {\r\n        $body = new BaseCollection();\r\n\r\n        $models->each(function ($model) use ($body) {\r\n            $array = $model->toSearchableArray();\r\n\r\n            if (empty($array)) {\r\n                return;\r\n            }\r\n\r\n            $body->push([\r\n                'index' => [\r\n                    '_index' => $this->index,\r\n                    '_type' => $model->searchableAs(),\r\n                    '_id' => $model->getKey(),\r\n                ],\r\n            ]);\r\n\r\n            $body->push($array);\r\n        });\r\n\r\n        $this->elasticsearch->bulk([\r\n            'refresh' => true,\r\n            'body' => $body->all(),\r\n        ]);\r\n    }\r\n```\r\n\r\nWhen only there is a model updated and `toSearchableArray` return empty, the `body` will be empty which is not correct and this message will never be consumed.\r\n"}}
{"actor":{"display_login":"duynguyenhoang"}}