add tests batch 20
This commit is contained in:
@@ -26,7 +26,7 @@ class BroadcastEmailImageService
|
||||
}
|
||||
|
||||
$mime = strtolower((string) $file->getMimeType());
|
||||
if (! isset($this->allowedTypes[$mime])) {
|
||||
if (!isset($this->allowedTypes[$mime])) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'status' => 415,
|
||||
@@ -43,17 +43,17 @@ class BroadcastEmailImageService
|
||||
}
|
||||
|
||||
$targetDir = public_path('uploads/email');
|
||||
if (! is_dir($targetDir)) {
|
||||
if (!is_dir($targetDir)) {
|
||||
@mkdir($targetDir, 0755, true);
|
||||
}
|
||||
|
||||
$ext = $this->allowedTypes[$mime];
|
||||
$newName = 'em_'.bin2hex(random_bytes(16)).'.'.$ext;
|
||||
$newName = 'em_' . bin2hex(random_bytes(16)) . '.' . $ext;
|
||||
$file->move($targetDir, $newName);
|
||||
|
||||
return [
|
||||
'ok' => true,
|
||||
'url' => asset('uploads/email/'.$newName),
|
||||
'url' => asset('uploads/email/' . $newName),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user