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

Add ability to suppress observer events #654

Closed
stoutput opened this issue May 6, 2022 · 2 comments
Closed

Add ability to suppress observer events #654

stoutput opened this issue May 6, 2022 · 2 comments
Labels
easy These issues are geared for people who have not yet contributed to this project yet enhancement A feature that exists, works as intended but needs to be improved

Comments

@stoutput
Copy link
Contributor

stoutput commented May 6, 2022

Describe the feature as you'd like to see it
Similar to Laravel's withoutEvents() and saveQuietly(), it would be nice to be able to deterministically suppress model events either with a context manager, method, flag, or some combination of the three.
It would also be nice to choose which events to suppress in the event that an action fires multiple (for instance, I believe save() fires saving, updating, saved, and updated). See: https://laravel.com/docs/9.x/eloquent#muting-events for inspiration.

What do we currently have to do now?
Currently, there is no way to suppress model events from firing. This is useful in a variety of scenarios. For instance, if you want to add data to a model after successful creation, there is currently no way to do so without triggering multiple events. If your observer emits global events for consumption across your app, this could cause issues.

@stoutput stoutput added the enhancement A feature that exists, works as intended but needs to be improved label May 6, 2022
@josephmancuso josephmancuso added the easy These issues are geared for people who have not yet contributed to this project yet label May 16, 2022
@stoutput
Copy link
Contributor Author

stoutput commented Jun 6, 2022

I believe this has been resolved in #693

@stoutput stoutput closed this as completed Jun 6, 2022
@josephmancuso
Copy link
Member

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy These issues are geared for people who have not yet contributed to this project yet enhancement A feature that exists, works as intended but needs to be improved
Projects
None yet
Development

No branches or pull requests

2 participants