1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-09-20 16:44:04 +00:00

Restore the central storage directory check in DeleteTenantStorage

The check compares the tenant's storage path with the bootstrapper's central storage
path, so unlike the original one, it doesn't depend on storage_path().

With the current path resolution, the two can only be the same if suffix_base and the
tenant's key are both empty, so this is just a safety net for weird configurations.
This commit is contained in:
lukinovec 2026-08-18 14:20:17 +02:00 committed by Samuel Stancl
parent b771fd13a9
commit 1fb9acec75

View file

@ -35,6 +35,12 @@ class DeleteTenantStorage implements ShouldQueue
public function handle(): void
{
$tenantStoragePath = FilesystemTenancyBootstrapper::getBoundTenantStoragePath($this->tenant);
$centralStoragePath = FilesystemTenancyBootstrapper::getBoundCentralStoragePath();
if (realpath($tenantStoragePath) === realpath($centralStoragePath)) {
// Never delete the central storage directory -- that would delete the files of all tenants
return;
}
if (is_dir($tenantStoragePath)) {
File::deleteDirectory($tenantStoragePath);