mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
clean up
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user