{"action":"created","issue":{"url":"https://api.github.com/repos/nWidart/laravel-modules/issues/484","repository_url":"https://api.github.com/repos/nWidart/laravel-modules","labels_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/484/labels{/name}","comments_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/484/comments","events_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/484/events","html_url":"https://github.com/nWidart/laravel-modules/issues/484","id":297799516,"number":484,"title":"How to use created models for the modules","user":{"login":"dbsoftsolutions","id":19725436,"avatar_url":"https://avatars0.githubusercontent.com/u/19725436?v=4","gravatar_id":"","url":"https://api.github.com/users/dbsoftsolutions","html_url":"https://github.com/dbsoftsolutions","followers_url":"https://api.github.com/users/dbsoftsolutions/followers","following_url":"https://api.github.com/users/dbsoftsolutions/following{/other_user}","gists_url":"https://api.github.com/users/dbsoftsolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/dbsoftsolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbsoftsolutions/subscriptions","organizations_url":"https://api.github.com/users/dbsoftsolutions/orgs","repos_url":"https://api.github.com/users/dbsoftsolutions/repos","events_url":"https://api.github.com/users/dbsoftsolutions/events{/privacy}","received_events_url":"https://api.github.com/users/dbsoftsolutions/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T14:18:56Z","updated_at":"2018-02-17T11:06:54Z","closed_at":"2018-02-17T11:06:54Z","author_association":"NONE","body":"Hi,\r\nI just started using your package for Laravel 5.5 (have not upgraded to 5.6 just yet). I created a new module called \"Core\" in which I created a model called \"Role\" which is located in Modules\\Core\\Entities\\Role.php. I use this with the default Laravel login system where it is to work with the User model found under - app\\User.php\r\n\r\nI have 2 questions:\r\n\r\n1) If I am to create an Eloquent relationship between the two models, for User.php I added:\r\n\r\n`use Modules\\Core\\Entities\\Role;`\r\n\r\nand added the following function:\r\n`public function role(){`\r\n`return $this->hasOne(Role::class, 'roleid');`\r\n`}`\r\n\r\nI assumed that is correct?\r\n\r\n2) When using PHP tinker, when I try to create an object using:\r\n`$role = new Modules\\Core\\Entities\\Role;`\r\nI get the following error:\r\n\r\n`PHP Fatal error:  Undefined constant Modules\\Core\\Entities\\Role in eval()'d code on line 1`\r\n\r\nHow do I get this to work? Sorry but I could not find this in the documentation."},"comment":{"url":"https://api.github.com/repos/nWidart/laravel-modules/issues/comments/366434005","html_url":"https://github.com/nWidart/laravel-modules/issues/484#issuecomment-366434005","issue_url":"https://api.github.com/repos/nWidart/laravel-modules/issues/484","id":366434005,"user":{"login":"nWidart","id":882397,"avatar_url":"https://avatars3.githubusercontent.com/u/882397?v=4","gravatar_id":"","url":"https://api.github.com/users/nWidart","html_url":"https://github.com/nWidart","followers_url":"https://api.github.com/users/nWidart/followers","following_url":"https://api.github.com/users/nWidart/following{/other_user}","gists_url":"https://api.github.com/users/nWidart/gists{/gist_id}","starred_url":"https://api.github.com/users/nWidart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nWidart/subscriptions","organizations_url":"https://api.github.com/users/nWidart/orgs","repos_url":"https://api.github.com/users/nWidart/repos","events_url":"https://api.github.com/users/nWidart/events{/privacy}","received_events_url":"https://api.github.com/users/nWidart/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T11:06:54Z","updated_at":"2018-02-17T11:06:54Z","author_association":"OWNER","body":"Hello,\r\n\r\nYou can use the usual laravel way of defining relationships.\r\nI'm not familiar with your php tinker. \r\nPlease refer to the laravel documentation for relationships."}}
{"actor":{"display_login":"nWidart"}}