From Laravel 8, you can bypass maintenance mode only for you with a secret route! It's a really nice and flexible feature to bypass maintenance mode only for you and your developer when the application in maintenance mode. We can use this kind of features in our existing laravel 6, laravel 7 projects with a lightweight laravel package called haruncpi/laravel-maintenance. Let's see how we can use it our project.
composer require haruncpi/laravel-maintenance
Now replace the default maintenance middleware in
- Enable maintenance mode with secret route
php artisan down --secret="mysecretkey"
- Maintenance bypass
mysecretkey is a secret key which we defined earlier in artisan down command. Make sure you make it complex for better security.
After visiting the secret route, you will get the application live only in your side and the rest of the world gets it in maintenance mode.
Doc & GitHub repository: haruncpi/laravel-maintenance