From 1fb9acec75cea9bbc4458f21e2038417aa42f71e Mon Sep 17 00:00:00 2001 From: lukinovec Date: Tue, 18 Aug 2026 14:20:17 +0200 Subject: [PATCH] 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. --- src/Jobs/DeleteTenantStorage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Jobs/DeleteTenantStorage.php b/src/Jobs/DeleteTenantStorage.php index 5dab4dcd..825eaef2 100644 --- a/src/Jobs/DeleteTenantStorage.php +++ b/src/Jobs/DeleteTenantStorage.php @@ -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);