Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent activities from being logged depending on the activity data #1

Open
erikgaal opened this issue Aug 6, 2018 · 4 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@erikgaal
Copy link
Contributor

erikgaal commented Aug 6, 2018

Currently, all events in a model's logged array are logged. We might want to prevent actually saving the activity based on the data in the activity.

For example, if a model Article is updated and (only) the published_at is changed. We might want to drop that activity in favour of the ArticlePublished or eloquent.published: 'App\Models\Article' event. Currently there only exist implementations to discard an event based on the event name in LogsActivity::shouldLogEvent($event) and to transform the activity data (but not discard) in LogsActivity::transformActivity($activity).

Any ideas on how to improve this behaviour are very much welcomed.

@erikgaal erikgaal added enhancement New feature or request help wanted Extra attention is needed labels Aug 6, 2018
@AnwarElbo
Copy link

Somewhere needs to be registered which activity has higher priority. This is a difficult one because eventually you don't know if the next activity had higher priority and needs to be dropped afterwards.

I think there should be some kind of rules array, that if column published_at is edited only use the published event as activity and so on. I can try to work it out and let you see an example of it.

@robertvansteen
Copy link

@AnwarElbo cool, sounds good! Looking forward to see it! 👍

AnwarElbo added a commit to AnwarElbo/laravel-journal that referenced this issue Aug 19, 2018
@AnwarElbo
Copy link

I have created a pull request, i am aware of the typo in the commit message, sorry about that 😅 . Let me know if anything doesn't seem right and I will try my best to change it

@erikgaal
Copy link
Contributor Author

Hey @AnwarElbo, thanks for the pull request! @rovansteen and I will be looking into it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants