mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
maintenance mode
This commit is contained in:
parent
111ec91cfb
commit
c5111ec00e
2 changed files with 30 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ return [
|
||||||
'Console commands' => 'console-commands',
|
'Console commands' => 'console-commands',
|
||||||
'Cached lookup' => 'cached-lookup',
|
'Cached lookup' => 'cached-lookup',
|
||||||
'Real-time facades' => 'realtime-facades',
|
'Real-time facades' => 'realtime-facades',
|
||||||
|
'Tenant maintenance mode' => 'tenant-maintenance-facades',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
29
source/docs/v3/tenant-maintenance-mode.blade.md
Normal file
29
source/docs/v3/tenant-maintenance-mode.blade.md
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
title: Tenant maintenance mode
|
||||||
|
extends: _layouts.documentation
|
||||||
|
section: content
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tenant maintenance mode {#tenant-maintenance-mode}
|
||||||
|
|
||||||
|
You may put specific tenants into maintenance mode using the `MaintenanceMode` trait.
|
||||||
|
|
||||||
|
Apply it on your [Tenant model]({{ $page->link('tenants') }}):
|
||||||
|
|
||||||
|
```php
|
||||||
|
use Stancl\Tenancy\Database\Concerns\MaintenanceMode;
|
||||||
|
|
||||||
|
class Tenant extends BaseTenant
|
||||||
|
{
|
||||||
|
use MaintenanceMode;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
This will let you use the following method on each tenant object:
|
||||||
|
```php
|
||||||
|
$tenant->putDownForMaintenance();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Middleware {#middleware}
|
||||||
|
|
||||||
|
You will also need to use the `Stancl\Tenancy\Middleware\CheckTenantForMaintenanceMode` middleware on your tenant routes.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue