mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 09:04:04 +00:00
Add maintenance mode events (#979)
This commit is contained in:
parent
080b271bb3
commit
3f60c4a652
5 changed files with 43 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Database\Concerns;
|
||||
use Stancl\Tenancy\Events\TenantMaintenanceModeDisabled;
|
||||
use Stancl\Tenancy\Events\TenantMaintenanceModeEnabled;
|
||||
|
||||
/**
|
||||
* @mixin \Illuminate\Database\Eloquent\Model
|
||||
|
|
@ -21,10 +23,14 @@ trait MaintenanceMode
|
|||
'status' => $data['status'] ?? 503,
|
||||
],
|
||||
]);
|
||||
|
||||
event(new TenantMaintenanceModeEnabled($this));
|
||||
}
|
||||
|
||||
public function bringUpFromMaintenance(): void
|
||||
{
|
||||
$this->update(['maintenance_mode' => null]);
|
||||
|
||||
event(new TenantMaintenanceModeDisabled($this));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue