DEV Community

Cover image for Laravel - Maintenance Mode (artisan)
Sandro Jhuliano Cagara
Sandro Jhuliano Cagara

Posted on

1

Laravel - Maintenance Mode (artisan)

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



php artisan down


Enter fullscreen mode Exit fullscreen mode

Then people would see default 503 status page.

Image description

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
  • retry page reload every X seconds ```

php artisan down --redirect="/" --render="errors::503" --secret="1630542a-246b-4b66-afa1-dd72a4c43515" --retry=60

Before Laravel 8:

- message that would be shown
- retry page reload every X seconds
- still allow the access to some IP address
Enter fullscreen mode Exit fullscreen mode

php artisan down --message="Upgrading Database" --retry=60 --allow=127.0.0.1

When you've done the maintenance work, just run:
Enter fullscreen mode Exit fullscreen mode

php artisan up

Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay