Skip to content

Commit 718f8df

Browse files
committed
refactor: remove unused method in HandleFileUploads trait
1 parent 998342e commit 718f8df

1 file changed

Lines changed: 1 addition & 33 deletions

File tree

app/Traits/HandlesFileUploads.php

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,10 @@ protected function storeFile(UploadedFile $file, string $directory, ?string $pre
3535
*/
3636
protected function deleteFile(?string $path, string $disk = 'public'): bool
3737
{
38-
if (!$path) {
38+
if (! $path) {
3939
return false;
4040
}
4141

4242
return Storage::disk($disk)->delete($path);
4343
}
44-
45-
/**
46-
* Handle multiple file uploads with optional deletion of old files
47-
*
48-
* @param array $files
49-
* @param array $fieldNames
50-
* @param string $directory
51-
* @param array|null $oldPaths
52-
* @return array
53-
*/
54-
protected function handleMultipleFileUploads(
55-
array $files,
56-
array $fieldNames,
57-
string $directory,
58-
?array $oldPaths = null
59-
): array {
60-
$uploadedPaths = [];
61-
62-
foreach ($fieldNames as $field) {
63-
if (isset($files[$field]) && $files[$field] instanceof UploadedFile) {
64-
// Delete old file if exists
65-
if ($oldPaths && isset($oldPaths[$field])) {
66-
$this->deleteFile($oldPaths[$field]);
67-
}
68-
69-
// Store new file
70-
$uploadedPaths[$field] = $this->storeFile($files[$field], $directory, $field);
71-
}
72-
}
73-
74-
return $uploadedPaths;
75-
}
7644
}

0 commit comments

Comments
 (0)