From 82551f5abe2c06311e2c3a4deabffaa33390c4c6 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 23 Oct 2025 15:29:02 +0530 Subject: [PATCH] Changed return json response in ocr --- routes/web.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/routes/web.php b/routes/web.php index b62b44d..2d8ea8c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -52,15 +52,15 @@ use thiagoalessio\TesseractOCR\TesseractOCR; ->config(['tessedit_char_whitelist' => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz']) ->run(); - //return response()->json(['success' => true, 'text' => $text]); - $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' => $text]); + // $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' => array_values($serials), // send as array - ]); + // return response()->json([ + // 'success' => true, + // 'text' => array_values($serials), // send as array + // ]); } //catch (\Exception $e) { // return response()->json(['success' => false, 'error' => $e->getMessage()]);