Source: medium.com

Laravel Maintenance Mode

Category: Laravel, PHP

This downtime could be for a lot of reasons, including but not limited to: The laravel framework ships with a smooth and stress-free way to put your app into maintenance mode and this can be accessed via an artisan command: php artisan down

This command has 3 optional flags: When your application is in maintenance mode, a customizable page is shown to users of your application to notify them that you’re in maintenance. Laravel makes use of four components to gracefully put your application in maintenance and to manage the maintenance mode.

It checks if the IP of the request is in the allowed to access the application while in maintenance mode, then checks if the route the request is trying to accept is in the excepts array — except array contains routes that can still be accessible when the app is in maintenance.

If your application runs a status page, or you want to notify a bunch of people about the status of your application, you can extend the default UpCommmand and DownCommand classes and add your custom logic in it.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners