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

[8.x] Dispatch events when maintenance mode is enabled and disabled #38826

Merged
merged 4 commits into from
Sep 15, 2021
Merged

[8.x] Dispatch events when maintenance mode is enabled and disabled #38826

merged 4 commits into from
Sep 15, 2021

Conversation

adevade
Copy link
Contributor

@adevade adevade commented Sep 15, 2021

This feature makes it easy to trigger actions when the application is put into, or taken out of, maintenance mode.

I found myself wanting this today when setting up monitoring with OhDear.
They have endpoints for /start-maintenance and /end-maintenance and will not send notifications about the site being down during this period.

If this PR is merged, I could listen for the events in my application and automatically ping my monitoring service when going in or out of maintenance mode. Or log it, or any action that users see fit.


I tried to follow conventions, but if anything is in the wrong place, or should have better names; just comment and I'll fix it, or feel free to refactor and push changes.

Thanks!

@taylorotwell taylorotwell merged commit 5398fbb into laravel:8.x Sep 15, 2021
@adevade adevade deleted the add-events-to-maintenance-mode-commands branch September 15, 2021 16:54
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
…aravel#38826)

* Add event classes

* Add tests

* Dispatch events when maintenance mode is enabled and disabled

* Remove empty constructors from event classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants