{"action":"created","issue":{"url":"https://api.github.com/repos/spatie/laravel-permission/issues/794","repository_url":"https://api.github.com/repos/spatie/laravel-permission","labels_url":"https://api.github.com/repos/spatie/laravel-permission/issues/794/labels{/name}","comments_url":"https://api.github.com/repos/spatie/laravel-permission/issues/794/comments","events_url":"https://api.github.com/repos/spatie/laravel-permission/issues/794/events","html_url":"https://github.com/spatie/laravel-permission/issues/794","id":340397566,"node_id":"MDU6SXNzdWUzNDAzOTc1NjY=","number":794,"title":"Question: Cannot view roles when extending the User model","user":{"login":"markandrewkato","id":5277002,"node_id":"MDQ6VXNlcjUyNzcwMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/5277002?v=4","gravatar_id":"","url":"https://api.github.com/users/markandrewkato","html_url":"https://github.com/markandrewkato","followers_url":"https://api.github.com/users/markandrewkato/followers","following_url":"https://api.github.com/users/markandrewkato/following{/other_user}","gists_url":"https://api.github.com/users/markandrewkato/gists{/gist_id}","starred_url":"https://api.github.com/users/markandrewkato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markandrewkato/subscriptions","organizations_url":"https://api.github.com/users/markandrewkato/orgs","repos_url":"https://api.github.com/users/markandrewkato/repos","events_url":"https://api.github.com/users/markandrewkato/events{/privacy}","received_events_url":"https://api.github.com/users/markandrewkato/received_events","type":"User","site_admin":false},"labels":[{"id":887733324,"node_id":"MDU6TGFiZWw4ODc3MzMzMjQ=","url":"https://api.github.com/repos/spatie/laravel-permission/labels/support","name":"support","color":"f9ef93","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-11T20:42:45Z","updated_at":"2018-07-12T13:19:01Z","closed_at":null,"author_association":"NONE","body":"I created a model (Agent) and extended the User model with it.\r\n\r\n`class Agent extends User`\r\n\r\n`assignRole('admin')` is working but when I try to get all the users with 'admin' role, it doesn't show up. On the model_has_roles table, the model type shows as App\\Agent. I assume that is the reason why it doesn't show.\r\n\r\nIf my assumption is correct, is there a way or a config on where I can change the model_type from App\\Agent to App\\User when assigning a role?\r\n\r\nPS. This is my first time posting a question in the issues and I don't know how to tag/label this one as a question. I apologise for that."},"comment":{"url":"https://api.github.com/repos/spatie/laravel-permission/issues/comments/404509166","html_url":"https://github.com/spatie/laravel-permission/issues/794#issuecomment-404509166","issue_url":"https://api.github.com/repos/spatie/laravel-permission/issues/794","id":404509166,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDUwOTE2Ng==","user":{"login":"markandrewkato","id":5277002,"node_id":"MDQ6VXNlcjUyNzcwMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/5277002?v=4","gravatar_id":"","url":"https://api.github.com/users/markandrewkato","html_url":"https://github.com/markandrewkato","followers_url":"https://api.github.com/users/markandrewkato/followers","following_url":"https://api.github.com/users/markandrewkato/following{/other_user}","gists_url":"https://api.github.com/users/markandrewkato/gists{/gist_id}","starred_url":"https://api.github.com/users/markandrewkato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markandrewkato/subscriptions","organizations_url":"https://api.github.com/users/markandrewkato/orgs","repos_url":"https://api.github.com/users/markandrewkato/repos","events_url":"https://api.github.com/users/markandrewkato/events{/privacy}","received_events_url":"https://api.github.com/users/markandrewkato/received_events","type":"User","site_admin":false},"created_at":"2018-07-12T13:19:01Z","updated_at":"2018-07-12T13:19:01Z","author_association":"NONE","body":"I'm doing the assignRole on Referral model like so:\r\n\r\n`\r\n$agent = Agent::create($data)->assignRole('agent');\r\n`\r\n\r\nCan I make the assignRole use `App\\User` instead of `App\\Agent` when using the assignRole on Agent model?"}}
{"actor":{"display_login":"markandrewkato"}}