{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/7023","labels_url":"https://api.github.com/repos/laravel/framework/issues/7023/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/7023/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/7023/events","html_url":"https://github.com/laravel/framework/issues/7023","id":54573818,"number":7023,"title":"[5.0] [Proposal] Use IoC in Eloquent relationships","user":{"login":"neomerx","id":10420662,"avatar_url":"https://avatars.githubusercontent.com/u/10420662?v=3","gravatar_id":"","url":"https://api.github.com/users/neomerx","html_url":"https://github.com/neomerx","followers_url":"https://api.github.com/users/neomerx/followers","following_url":"https://api.github.com/users/neomerx/following{/other_user}","gists_url":"https://api.github.com/users/neomerx/gists{/gist_id}","starred_url":"https://api.github.com/users/neomerx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neomerx/subscriptions","organizations_url":"https://api.github.com/users/neomerx/orgs","repos_url":"https://api.github.com/users/neomerx/repos","events_url":"https://api.github.com/users/neomerx/events{/privacy}","received_events_url":"https://api.github.com/users/neomerx/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-01-16T13:11:42Z","updated_at":"2015-02-07T11:15:27Z","closed_at":"2015-02-06T22:42:14Z","body":"Reasons\r\n1) More flexibility and all the benefits of IoC in relationship descriptions.\r\n2) Models could be extended with new fields without necessity to change original model. New fields could be added in children classes with IoC binding overridden.\r\n\r\nRequired fix\r\nChange statements like\r\n~~~\r\n$instance = new $related;\r\n~~~\r\nto IoC in Model::BelongsTo, Model::morphTo and etc.\r\n\r\nOr make it easily to override with replacing to something like\r\n~~~\r\nprotected function createInstance($inctanceClass)\r\n{\r\n    return new $inctanceClass;\r\n}\r\n~~~"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/73360179","html_url":"https://github.com/laravel/framework/issues/7023#issuecomment-73360179","issue_url":"https://api.github.com/repos/laravel/framework/issues/7023","id":73360179,"user":{"login":"GrahamCampbell","id":2829600,"avatar_url":"https://avatars.githubusercontent.com/u/2829600?v=3","gravatar_id":"","url":"https://api.github.com/users/GrahamCampbell","html_url":"https://github.com/GrahamCampbell","followers_url":"https://api.github.com/users/GrahamCampbell/followers","following_url":"https://api.github.com/users/GrahamCampbell/following{/other_user}","gists_url":"https://api.github.com/users/GrahamCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/GrahamCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GrahamCampbell/subscriptions","organizations_url":"https://api.github.com/users/GrahamCampbell/orgs","repos_url":"https://api.github.com/users/GrahamCampbell/repos","events_url":"https://api.github.com/users/GrahamCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/GrahamCampbell/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T11:15:27Z","updated_at":"2015-02-07T11:15:27Z","body":"We have a 2 week human timeout system."}}