mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 09:04:04 +00:00
Tenant-specific maintenance mode
This commit is contained in:
parent
ac58f6992b
commit
2fedd5ce88
3 changed files with 96 additions and 0 deletions
18
src/Database/Concerns/MaintenanceMode.php
Normal file
18
src/Database/Concerns/MaintenanceMode.php
Normal 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'] ?? [],
|
||||
]]);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue