diff --git a/app/ticket/service/TicketService.php b/app/ticket/service/TicketService.php index e225dec..7f74902 100644 --- a/app/ticket/service/TicketService.php +++ b/app/ticket/service/TicketService.php @@ -45,9 +45,10 @@ class TicketService (new AttachmentLogic())->adds($attachment, $result->id, $data['user_id']); } + $cleanContent = trim(preg_replace('/\s+/', ' ', strip_tags($data['content'] ?? ''))); $conversation = [ 'ticket_id' => $result->id, - 'content' => $data['content'], + 'content' => $cleanContent, 'user_id' => $data['user_id'], ]; (new ConversationService())->add($conversation);