{"action":"opened","issue":{"url":"https://api.github.com/repos/Zizaco/entrust/issues/339","labels_url":"https://api.github.com/repos/Zizaco/entrust/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/Zizaco/entrust/issues/339/comments","events_url":"https://api.github.com/repos/Zizaco/entrust/issues/339/events","html_url":"https://github.com/Zizaco/entrust/issues/339","id":93787057,"number":339,"title":"Laravel 5.1: attachPermissions fails with \"Unknown Column 'entrust_role_id'\"","user":{"login":"smohring","id":8200891,"avatar_url":"https://avatars.githubusercontent.com/u/8200891?v=3","gravatar_id":"","url":"https://api.github.com/users/smohring","html_url":"https://github.com/smohring","followers_url":"https://api.github.com/users/smohring/followers","following_url":"https://api.github.com/users/smohring/following{/other_user}","gists_url":"https://api.github.com/users/smohring/gists{/gist_id}","starred_url":"https://api.github.com/users/smohring/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smohring/subscriptions","organizations_url":"https://api.github.com/users/smohring/orgs","repos_url":"https://api.github.com/users/smohring/repos","events_url":"https://api.github.com/users/smohring/events{/privacy}","received_events_url":"https://api.github.com/users/smohring/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-08T13:17:04Z","updated_at":"2015-07-08T13:17:04Z","closed_at":null,"body":"Hi,\r\n\r\nWhen doing \r\n$role->attachPermissions([$permission]);\r\nfrom a database seed file, i get the following error:\r\n\r\n [PDOException]                                                                            \r\n  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entrust_role_id' in 'field list' \r\n\r\nI managed to fix that, by altering the following file:\r\n/vendor/zizaco/entrust/src/Entrust/Traits/EntrustRoleTrait.php\r\n\r\nAnd add the correct foreign key to the relation at line 33 from\r\n        \r\nreturn $this->belongsToMany(Config::get('entrust.permission'), Config::get('entrust.permission_role_table'));\r\n\r\nto\r\n\r\n        return $this->belongsToMany(Config::get('entrust.permission'), Config::get('entrust.permission_role_table'), 'role_id');\r\n\r\n\r\nNow the migration runs properly. Did i miss something or is this a bug?\r\n\r\nRegards\r\n\r\n"}}