Skip to content

Commit 5208fb2

Browse files
[11.x] Add maintenance mode on multiple servers (laravel#9568)
* Add maintenance mode on multiple servers * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 5f49bc6 commit 5208fb2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

configuration.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,20 @@ When accessing this hidden route, you will then be redirected to the `/` route o
301301
> [!NOTE]
302302
> Your maintenance mode secret should typically consist of alpha-numeric characters and, optionally, dashes. You should avoid using characters that have special meaning in URLs such as `?` or `&`.
303303
304+
<a name="maintenance-mode-on-multiple-servers"></a>
305+
#### Maintenance Mode on Multiple Servers
306+
307+
By default, Laravel determines if your application is in maintenance mode using a file-based system. This means to activate maintenance mode, the `php artisan down` command has to be executed on each server hosting your application.
308+
309+
Alternatively, Laravel offers a cache-based method for handling maintenance mode. This method requires running the `php artisan down` command on just one server. To use this approach, modify the "driver" setting in the `config/app.php` file of your application to `cache`. Then, select a cache `store` that is accessible by all your servers. This ensures the maintenance mode status is consistently maintained across every server:
310+
311+
```php
312+
'maintenance' => [
313+
'driver' => 'cache',
314+
'store' => 'database',
315+
],
316+
```
317+
304318
<a name="pre-rendering-the-maintenance-mode-view"></a>
305319
#### Pre-Rendering the Maintenance Mode View
306320

0 commit comments

Comments
 (0)