1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 05:34:04 +00:00
This commit is contained in:
ju5t 2026-01-16 13:47:43 +10:00 committed by GitHub
commit 0c2433b2c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,12 +22,18 @@ class DeleteDatabase implements ShouldQueue
protected TenantWithDatabase&Model $tenant,
) {}
public function handle(): void
public function handle(): bool
{
event(new DeletingDatabase($this->tenant));
if ($this->tenant->getInternal('create_database') === false) {
return false;
}
$this->tenant->database()->manager()->deleteDatabase($this->tenant);
event(new DatabaseDeleted($this->tenant));
return true;
}
}