add more controllers and fix tests

This commit is contained in:
root
2026-03-09 11:54:13 -04:00
parent 0c3e9b16f7
commit 1cb3573d4b
74 changed files with 2761 additions and 2728 deletions
@@ -0,0 +1,35 @@
<?php
namespace App\Services\Email;
use Illuminate\Http\UploadedFile;
class EmailAttachmentService
{
public function normalize($files): array
{
if ($files instanceof UploadedFile) {
$files = [$files];
}
if (!is_array($files)) {
return [];
}
$out = [];
foreach ($files as $file) {
if (!$file instanceof UploadedFile || !$file->isValid()) {
continue;
}
$path = $file->getRealPath();
if (!$path || !is_file($path)) {
continue;
}
$out[] = [
'path' => $path,
'name' => $file->getClientOriginalName(),
];
}
return $out;
}
}