mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 17:34:03 +00:00
events dispatched
This commit is contained in:
parent
7305c9e65b
commit
35f724128b
1 changed files with 6 additions and 0 deletions
|
|
@ -5,16 +5,22 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\Database\Concerns;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Stancl\Tenancy\Events\TenantGoingInMaintenanceMode;
|
||||
use Stancl\Tenancy\Events\TenantWentInMaintenanceMode;
|
||||
|
||||
trait MaintenanceMode
|
||||
{
|
||||
public function putDownForMaintenance($data = [])
|
||||
{
|
||||
event(new TenantGoingInMaintenanceMode($this));
|
||||
|
||||
$this->update(['maintenance_mode' => [
|
||||
'time' => $data['time'] ?? Carbon::now()->getTimestamp(),
|
||||
'message' => $data['message'] ?? null,
|
||||
'retry' => $data['retry'] ?? null,
|
||||
'allowed' => $data['allowed'] ?? [],
|
||||
]]);
|
||||
|
||||
event(new TenantWentInMaintenanceMode($this));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue