1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 01:14:04 +00:00

Tenant-specific maintenance mode

This commit is contained in:
Samuel Štancl 2020-05-20 21:50:10 +02:00
parent ac58f6992b
commit 2fedd5ce88
3 changed files with 96 additions and 0 deletions

View file

@ -0,0 +1,18 @@
<?php
namespace Stancl\Tenancy\Database\Concerns;
use Carbon\Carbon;
trait MaintenanceMode
{
public function putDownForMaintenance($data = [])
{
$this->update(['maintenance_mode' => [
'time' => $data['time'] ?? Carbon::now()->getTimestamp(),
'message' => $data['message'] ?? null,
'retry' => $data['retry'] ?? null,
'allowed' => $data['allowed'] ?? [],
]]);
}
}