{"action":"created","issue":{"url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/460","repository_url":"https://api.github.com/repos/spatie/laravel-activitylog","labels_url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/460/labels{/name}","comments_url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/460/comments","events_url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/460/events","html_url":"https://github.com/spatie/laravel-activitylog/issues/460","id":378836737,"node_id":"MDU6SXNzdWUzNzg4MzY3Mzc=","number":460,"title":"Opposite of $ignoreChangedAttributes?","user":{"login":"bluec","id":1577895,"node_id":"MDQ6VXNlcjE1Nzc4OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1577895?v=4","gravatar_id":"","url":"https://api.github.com/users/bluec","html_url":"https://github.com/bluec","followers_url":"https://api.github.com/users/bluec/followers","following_url":"https://api.github.com/users/bluec/following{/other_user}","gists_url":"https://api.github.com/users/bluec/gists{/gist_id}","starred_url":"https://api.github.com/users/bluec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluec/subscriptions","organizations_url":"https://api.github.com/users/bluec/orgs","repos_url":"https://api.github.com/users/bluec/repos","events_url":"https://api.github.com/users/bluec/events{/privacy}","received_events_url":"https://api.github.com/users/bluec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-08T17:21:41Z","updated_at":"2018-11-08T17:52:20Z","closed_at":null,"author_association":"NONE","body":"May be useful to have a reverse of this, something like `$ignoreChangedAttributesExcept` or `$onlyChangedAttributes`?\r\n\r\ni.e. we list only the attributes that we wish to trigger an activity being logged.\r\n\r\nDoes such a thing exist? Would anyone else find it useful? Have I overlooked another way to do this?"},"comment":{"url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/comments/437094599","html_url":"https://github.com/spatie/laravel-activitylog/issues/460#issuecomment-437094599","issue_url":"https://api.github.com/repos/spatie/laravel-activitylog/issues/460","id":437094599,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzA5NDU5OQ==","user":{"login":"Gummibeer","id":6187884,"node_id":"MDQ6VXNlcjYxODc4ODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6187884?v=4","gravatar_id":"","url":"https://api.github.com/users/Gummibeer","html_url":"https://github.com/Gummibeer","followers_url":"https://api.github.com/users/Gummibeer/followers","following_url":"https://api.github.com/users/Gummibeer/following{/other_user}","gists_url":"https://api.github.com/users/Gummibeer/gists{/gist_id}","starred_url":"https://api.github.com/users/Gummibeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gummibeer/subscriptions","organizations_url":"https://api.github.com/users/Gummibeer/orgs","repos_url":"https://api.github.com/users/Gummibeer/repos","events_url":"https://api.github.com/users/Gummibeer/events{/privacy}","received_events_url":"https://api.github.com/users/Gummibeer/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T17:52:19Z","updated_at":"2018-11-08T17:52:19Z","author_association":"COLLABORATOR","body":"There were already a lot of variables that allow to customize the logged attributes. A new one will just make this package a lot more complicated. I would recommend you, if you need this, to override the `shouldLogEvent()` method, which uses the `$ignoreChangedAttributes`.\r\nhttps://github.com/spatie/laravel-activitylog/blob/c1dd4932d21216a3d0b23778c867ee1000eb87c7/src/Traits/LogsActivity.php#L107-L125\r\nOn the last line you could add your logic and use `array_only()` or you change `attributesToBeIgnored()` method and inverse your whitelist via the available attributes to the already existing blacklist. This could also be done on `boot()` in best case via trait-boot-method https://laravel-news.com/booting-eloquent-model-traits - this way you won't touch any of the package logic but could get your request done in your own trait.\r\nIf you got the trait work you are free to create a gist with it and link it here for others with this request. Keep in mind that `$ignoreChangedAttributes` does not remove the attributes from the log entry but just is used to decide if the entry has to be logged or not. "}}
{"actor":{"display_login":"Gummibeer"}}