tenancy-docs/source/docs/v3/tenant-maintenance-mode.blade.md
Piyush Manolkar b05600b4dd
Update tenant-maintenance-mode.blade.md
Add documentation to remove tenant from maintainance mode.
2022-02-25 18:55:13 +05:30

794 B

title extends section
Tenant maintenance mode _layouts.documentation content

Tenant maintenance mode

You may put specific tenants into maintenance mode using the MaintenanceMode trait.

Apply it on your [Tenant model]({{ $page->link('tenants') }}):

use Stancl\Tenancy\Database\Concerns\MaintenanceMode;

class Tenant extends BaseTenant
{
    use MaintenanceMode;
}

This will let you use the following method on each tenant object:

$tenant->putDownForMaintenance();

To remove specific tenant from maintainance mode:

$tenant->update(['maintenance_mode' => null]);

Middleware

You will also need to use the Stancl\Tenancy\Middleware\CheckTenantForMaintenanceMode middleware on your tenant routes.