ideas icon indicating copy to clipboard operation
ideas copied to clipboard

More flexibility whilst in maintenance mode.

Open KieronWiltshire opened this issue 3 years ago • 0 comments

I'd like to propose some changes to the PreventRequestsDuringMaintenance middleware. Specifically the lines highlighted below... https://github.com/laravel/framework/blob/8.x/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php#L60-L76

Extending this middleware in the Laravel application itself through CheckForMaintenanceMode isn't very flexible in terms of what it offers. It would be useful to provide the redirect and template through the middleware itself instead of via the command, even if these are just for fallback purposes, it's also probably worth returning a JSON equivalent response for applications that want a JSON response instead of a template (for APIs etc...) A possibility could be a 503.json instead of a 503.html (for vapor)

This helps in deployments like vapor where you may want to just visit the vapor dashboard, put into maintenance and use some preconfigured values - adding to this it would be useful to be able to provide a bypass secret via the vapor dashboard.

KieronWiltshire avatar May 10 '21 13:05 KieronWiltshire