{"action":"created","issue":{"url":"https://api.github.com/repos/acoustep/entrust-gui/issues/21","repository_url":"https://api.github.com/repos/acoustep/entrust-gui","labels_url":"https://api.github.com/repos/acoustep/entrust-gui/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/acoustep/entrust-gui/issues/21/comments","events_url":"https://api.github.com/repos/acoustep/entrust-gui/issues/21/events","html_url":"https://github.com/acoustep/entrust-gui/issues/21","id":179178489,"number":21,"title":"manyTomany events","user":{"login":"jubayerarefin","id":18138076,"avatar_url":"https://avatars.githubusercontent.com/u/18138076?v=3","gravatar_id":"","url":"https://api.github.com/users/jubayerarefin","html_url":"https://github.com/jubayerarefin","followers_url":"https://api.github.com/users/jubayerarefin/followers","following_url":"https://api.github.com/users/jubayerarefin/following{/other_user}","gists_url":"https://api.github.com/users/jubayerarefin/gists{/gist_id}","starred_url":"https://api.github.com/users/jubayerarefin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubayerarefin/subscriptions","organizations_url":"https://api.github.com/users/jubayerarefin/orgs","repos_url":"https://api.github.com/users/jubayerarefin/repos","events_url":"https://api.github.com/users/jubayerarefin/events{/privacy}","received_events_url":"https://api.github.com/users/jubayerarefin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-26T09:23:23Z","updated_at":"2016-10-09T09:23:27Z","closed_at":null,"body":"First of all, thanks for providing a nice package for `Entrust`. I would like like to know how can I add/extend the package to add manyTomany events such as: `attached`, `detached` or `synced`.\r\n\r\nI have added a function to my `User` and `Role` model and I can listen to the events. But need to use for all the `attach`, `detach` or `sync` done from the package.\r\n\r\nHere is my function:\r\n\r\n`public function syncRoles($ids, $detaching = true)\r\n    {\r\n        static::$dispatcher->fire(new Syncing($this, $ids, $detaching));\r\n\r\n        $result = $this->roles()->sync($ids, $detaching);\r\n\r\n        if ($detached = $result['detached']) {\r\n            static::$dispatcher->fire(new Detached($this, $detached));\r\n        }\r\n\r\n        if ($attached = $result['attached']) {\r\n            static::$dispatcher->fire(new Attached($this, $attached));\r\n        }\r\n    }`\r\n\r\nAny kind of help is appreciated. Thanks in advance."},"comment":{"url":"https://api.github.com/repos/acoustep/entrust-gui/issues/comments/252475151","html_url":"https://github.com/acoustep/entrust-gui/issues/21#issuecomment-252475151","issue_url":"https://api.github.com/repos/acoustep/entrust-gui/issues/21","id":252475151,"user":{"login":"jubayerarefin","id":18138076,"avatar_url":"https://avatars.githubusercontent.com/u/18138076?v=3","gravatar_id":"","url":"https://api.github.com/users/jubayerarefin","html_url":"https://github.com/jubayerarefin","followers_url":"https://api.github.com/users/jubayerarefin/followers","following_url":"https://api.github.com/users/jubayerarefin/following{/other_user}","gists_url":"https://api.github.com/users/jubayerarefin/gists{/gist_id}","starred_url":"https://api.github.com/users/jubayerarefin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubayerarefin/subscriptions","organizations_url":"https://api.github.com/users/jubayerarefin/orgs","repos_url":"https://api.github.com/users/jubayerarefin/repos","events_url":"https://api.github.com/users/jubayerarefin/events{/privacy}","received_events_url":"https://api.github.com/users/jubayerarefin/received_events","type":"User","site_admin":false},"created_at":"2016-10-09T09:23:27Z","updated_at":"2016-10-09T09:23:27Z","body":"Hi @acoustep thanks for your response. Yes, I guess I can use the solution you have suggested. Though it would be nice to have two properties `attached` & `detached` with the array of added and removed id of the roles.\r\n\r\nThanks again."}}
{"actor":{"display_login":"jubayerarefin"}}