From 48a6391bb18bc3a35814fd67f3a893149c3391ca Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 23 Oct 2025 15:20:26 +0530 Subject: [PATCH] changed logic in api in ocr --- routes/web.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 9041c4f..b62b44d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -56,7 +56,11 @@ use thiagoalessio\TesseractOCR\TesseractOCR; $lines = preg_split('/\r\n|\r|\n/', $text); $serials = array_filter(array_map('trim', $lines), fn($line) => preg_match('/^[A-Z0-9]+$/', $line)); - return response()->json(['success' => true, 'text' => $serials]); + //return response()->json(['success' => true, 'text' => $serials]); + return response()->json([ + 'success' => true, + 'text' => array_values($serials), // send as array + ]); } //catch (\Exception $e) { // return response()->json(['success' => false, 'error' => $e->getMessage()]);