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);