Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Bypass Maintenance Mode in Laravel

Maintenance Mode is an important aspect of any web application’s lifecycle, allowing us, the developers, to perform updates, fixes, and improvements.

In Laravel, you can get your application into maintenance mode by executing the php artisan down command.

But this makes it so that no one can access the application, not even you, the developer.

In this tutorial, I will show you how to bypass the maintenance mode and access the application.

Bypassing the Maintenance Mode

We have two options:

  1. php artisan down --secret=your-secret-key
  2. php artisan down --with-secret — tells Laravel to generate a secret token

I’d choose the latter as it’s more secure.


Copy the generated key then navigate to your project URL and add it to the base URL (i.e https://example.com/YourGeneratedSecretKeyGoesHere).

You should now be able to bypass the maintenance mode and have access to the application.

Check out this video for a showcase of this functionality:

How does it work?

To accomplish this, Laravel sets a laravel_maintenance cookie on your browser.

As long as you have the cookie, you can access the app bypassing the maintenance mode.



This post first appeared on Neutron Dev, please read the originial post: here

Share the post

Bypass Maintenance Mode in Laravel

×

Subscribe to Neutron Dev

Get updates delivered right to your inbox!

Thank you for your subscription

×