Ensure proper cleanup on hosted

This commit is contained in:
David Bomba
2025-09-08 10:32:14 +10:00
parent 5ff1b60381
commit df57be359a

View File

@@ -552,7 +552,23 @@ class CompanyController extends BaseController
});
try {
Storage::disk(config('filesystems.default'))->deleteDirectory($company->company_key);
if(Ninja::isHosted()){
try{
Storage::disk('s3')->deleteDirectory($company->company_key);
}
catch(\Throwable $th){}
try{
Storage::disk('backup')->deleteDirectory($company->company_key);
}
catch(\Throwable $th){}
}
else {
Storage::disk(config('filesystems.default'))->deleteDirectory($company->company_key);
}
} catch (\Exception $e) {
}