{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/ideas/issues/1473","repository_url":"https://api.github.com/repos/laravel/ideas","labels_url":"https://api.github.com/repos/laravel/ideas/issues/1473/labels{/name}","comments_url":"https://api.github.com/repos/laravel/ideas/issues/1473/comments","events_url":"https://api.github.com/repos/laravel/ideas/issues/1473/events","html_url":"https://github.com/laravel/ideas/issues/1473","id":396188038,"node_id":"MDU6SXNzdWUzOTYxODgwMzg=","number":1473,"title":"[Proposal] Use Macroable trait on eloquent models","user":{"login":"imanghafoori1","id":6961695,"node_id":"MDQ6VXNlcjY5NjE2OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/6961695?v=4","gravatar_id":"","url":"https://api.github.com/users/imanghafoori1","html_url":"https://github.com/imanghafoori1","followers_url":"https://api.github.com/users/imanghafoori1/followers","following_url":"https://api.github.com/users/imanghafoori1/following{/other_user}","gists_url":"https://api.github.com/users/imanghafoori1/gists{/gist_id}","starred_url":"https://api.github.com/users/imanghafoori1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imanghafoori1/subscriptions","organizations_url":"https://api.github.com/users/imanghafoori1/orgs","repos_url":"https://api.github.com/users/imanghafoori1/repos","events_url":"https://api.github.com/users/imanghafoori1/events{/privacy}","received_events_url":"https://api.github.com/users/imanghafoori1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-05T18:19:28Z","updated_at":"2019-01-05T18:19:28Z","closed_at":null,"author_association":"NONE","body":"The fact that laravel packages (modules in other words) can not introduce new relations on the models that exist in the other modules creates coupling problems.\r\n\r\nFor example if we have a `commenting` package which has a `Comment` model and some migrations to hold comments in a `comments` table.\r\n\r\nwhen installed there is no way, except to expose a trait to put on the `User` model to reflect the relation between Comments and User. Ok this is not the end of the world, we can live with it.\r\nBut, when we add an other package to help us have `like` and `dislike` on the `Comment` model.\r\nthen how to put the trait on a model which is already in the vendor folder ?!\r\n\r\nIf eloquent models where macroable the relations could have been added without the need of touching the code of model classes, Dynamically from service providers..."}}
{"actor":{"display_login":"imanghafoori1"}}