This commit is contained in:
Dan Harrin
2025-06-22 11:09:23 +01:00
parent e1c51c8f3e
commit dc9aef47a2
2 changed files with 4 additions and 4 deletions
@@ -176,8 +176,8 @@ trait CanExportRecords
// Temporary save to obtain the sequence number of the export file.
$export->save();
// Clear the export directory to prevent data contamination from previous exports with the same ID
$export->clearFileDirectory();
// Delete the export directory to prevent data contamination from previous exports with the same ID.
$export->deleteFileDirectory();
$export->file_name = $action->getFileName($export) ?? $exporter->getFileName($export);
$export->save();
@@ -100,10 +100,10 @@ class Export extends Model
return 'filament_exports' . DIRECTORY_SEPARATOR . $this->getKey();
}
public function clearFileDirectory(): void
public function deleteFileDirectory(): void
{
$directory = $this->getFileDirectory();
$disk = $this->getFileDisk();
$directory = $this->getFileDirectory();
if ($disk->directoryExists($directory)) {
$disk->deleteDirectory($directory);