Maintenance Mode

If you want to enable maintenance mode on your page, execute the down Artisan command:

1php artisan down

Then people would see default 503 status page.

You may also provide flags, in Laravel 8:

  • the path the user should be redirected to
  • the view that should be prerendered
  • secret phrase to bypass maintenance mode
  • status code during maintenance mode
  • retry page reload every X seconds
1php artisan down --redirect="/" --render="errors::503" --secret="1630542a-246b-4b66-afa1-dd72a4c43515" --status=200 --retry=60

Before Laravel 8:

  • message that would be shown
  • retry page reload every X seconds
  • still allow the access to some IP address
1php artisan down --message="Upgrading Database" --retry=60 --allow=127.0.0.1

When you've done the maintenance work, just run:

1php artisan up

Like our articles?

Become a Premium Member for $129/year or $29/month
What else you will get:
  • 22 courses (477 lessons, total 38 h 20 min)
  • 2 long-form tutorials (one new every week)
  • access to project repositories
  • access to private Discord