Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[12.x] Add maintenance mode facade for easier driver extension #56090

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

Open
wants to merge 6 commits into
base: 12.x
Choose a base branch
from

Conversation

ziadoz
Copy link
Contributor

@ziadoz ziadoz commented Jun 20, 2025

I was trying to register a new maintenance mode driver in my app, and noticed a paper cut.

This PR adds a facade for maintenance mode, so a new driver can be registered by doing:

MaintenanceMode::extend('test', fn () => ...);

Instead of having to retrieve the underlying manager class:

$this->app->get(MaintenanceModeManager::class)->extend('test', fn () => ...);

This matches up with elsewhere in Laravel, like Mail::extend(...) and Storage::extend(...).

It also binds maintenance and maintenance.manager strings into the container, so they can be used to retrieve the current maintenance mode driver and manager, like other core dependencies. FQNs still work like before.

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@ziadoz ziadoz marked this pull request as ready for review June 20, 2025 13:01
@ziadoz ziadoz changed the title [12.x] Add maintenance mode facade for easier driver extending [12.x] Add maintenance mode facade for easier driver extension Jun 20, 2025
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.

1 participant