{"action":"created","issue":{"url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/383","repository_url":"https://api.github.com/repos/owen-it/laravel-auditing","labels_url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/383/labels{/name}","comments_url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/383/comments","events_url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/383/events","html_url":"https://github.com/owen-it/laravel-auditing/issues/383","id":295203951,"number":383,"title":"Updating model via Eloquent relationship does not audit model changes","user":{"login":"brynj-digital","id":13166627,"avatar_url":"https://avatars0.githubusercontent.com/u/13166627?v=4","gravatar_id":"","url":"https://api.github.com/users/brynj-digital","html_url":"https://github.com/brynj-digital","followers_url":"https://api.github.com/users/brynj-digital/followers","following_url":"https://api.github.com/users/brynj-digital/following{/other_user}","gists_url":"https://api.github.com/users/brynj-digital/gists{/gist_id}","starred_url":"https://api.github.com/users/brynj-digital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brynj-digital/subscriptions","organizations_url":"https://api.github.com/users/brynj-digital/orgs","repos_url":"https://api.github.com/users/brynj-digital/repos","events_url":"https://api.github.com/users/brynj-digital/events{/privacy}","received_events_url":"https://api.github.com/users/brynj-digital/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T16:30:08Z","updated_at":"2018-02-07T18:01:11Z","closed_at":"2018-02-07T18:01:11Z","author_association":"NONE","body":"| Q                 | A\r\n| ----------------- | ---\r\n| Bug?              | yes\r\n| New Feature?      | no\r\n| Framework         | Laravel\r\n| Framework version | 5.5.34\r\n| Package version   | 5.0.4\r\n| PHP version       | 7.1.7\r\n\r\n#### Actual Behaviour\r\n\r\nI have a model instance that I'm then using to reference and update the attributes of an Eloquent relationship. Updates work fine, but are not logged by the package.\r\n\r\n#### Expected Behaviour\r\n\r\nI would expect the model which is referenced by the Eloquent relationship to have all changes logged. \r\n\r\n\r\n#### Steps to Reproduce\r\n\r\nI have Customer model that has a one to many relationship `addresses()`, with CustomerAddress. I am updating existing customer addresses with:\r\n\r\n`$customer->addresses()->where('id', $address_id)->update($address);` \r\n\r\nThis works, but no changes are logged. Both my Customer and CustomerAddress models implement Auditable and use the Auditable trait.\r\n\r\nIf I explicitly find the required instance of my CustomerAddress, and update this, the changes get logged. This works, basically:\r\n\r\n`CustomerAddress::findOrFail($address_id)->update($address);`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/comments/363855752","html_url":"https://github.com/owen-it/laravel-auditing/issues/383#issuecomment-363855752","issue_url":"https://api.github.com/repos/owen-it/laravel-auditing/issues/383","id":363855752,"user":{"login":"quetzyg","id":1413966,"avatar_url":"https://avatars3.githubusercontent.com/u/1413966?v=4","gravatar_id":"","url":"https://api.github.com/users/quetzyg","html_url":"https://github.com/quetzyg","followers_url":"https://api.github.com/users/quetzyg/followers","following_url":"https://api.github.com/users/quetzyg/following{/other_user}","gists_url":"https://api.github.com/users/quetzyg/gists{/gist_id}","starred_url":"https://api.github.com/users/quetzyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quetzyg/subscriptions","organizations_url":"https://api.github.com/users/quetzyg/orgs","repos_url":"https://api.github.com/users/quetzyg/repos","events_url":"https://api.github.com/users/quetzyg/events{/privacy}","received_events_url":"https://api.github.com/users/quetzyg/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T18:01:11Z","updated_at":"2018-02-07T18:01:11Z","author_association":"MEMBER","body":"Read the [troubleshooting](http://www.laravel-auditing.com/docs/5.0/troubleshooting) section of the documentation. You'll know why it doesn't work."}}
{"actor":{"display_login":"quetzyg"}}