1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-03-21 23:44:03 +00:00
This commit is contained in:
Thomas 2026-03-19 12:07:22 -04:00 committed by GitHub
commit 42774417c4
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;
}
}