changes
@ -238,9 +238,13 @@ public function sendMessage(Request $request, $id)
|
||||
$attachmentPath = $file->store('chat_attachments', 'public');
|
||||
|
||||
$mime = $file->getMimeType();
|
||||
if (str_starts_with($mime, 'image/')) {
|
||||
$extension = strtolower($file->getClientOriginalExtension());
|
||||
$audioExtensions = ['mp3', 'wav', 'm4a', 'ogg', 'webm', 'aac', '3gp', 'amr'];
|
||||
$imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];
|
||||
|
||||
if (str_starts_with($mime, 'image/') || in_array($extension, $imageExtensions)) {
|
||||
$attachmentType = 'image';
|
||||
} elseif (str_starts_with($mime, 'audio/')) {
|
||||
} elseif (str_starts_with($mime, 'audio/') || in_array($extension, $audioExtensions)) {
|
||||
$attachmentType = 'voice';
|
||||
} else {
|
||||
$attachmentType = 'document';
|
||||
|
||||
BIN
public/uploads/documents/1780479926_passport_1000416581.jpg
Normal file
|
After Width: | Height: | Size: 417 KiB |
BIN
public/uploads/documents/1780479926_visa_1000416581.jpg
Normal file
|
After Width: | Height: | Size: 417 KiB |
BIN
public/uploads/documents/1780480279_passport_1000287581.jpg
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
public/uploads/documents/1780480279_visa_1000287581.jpg
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
public/uploads/documents/1780481268_passport_1000416581.jpg
Normal file
|
After Width: | Height: | Size: 417 KiB |
BIN
public/uploads/documents/1780481268_visa_1000416581.jpg
Normal file
|
After Width: | Height: | Size: 417 KiB |
BIN
public/uploads/documents/1780484098_passport_1000416131.jpg
Normal file
|
After Width: | Height: | Size: 308 KiB |
BIN
public/uploads/documents/1780484098_visa_1000416131.jpg
Normal file
|
After Width: | Height: | Size: 308 KiB |