From 4c32400f37af9eeee026acd1431dad91af454178 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 23 Oct 2025 15:41:08 +0530 Subject: [PATCH] Added logic fo serils --- routes/web.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 2dca96a..e288f23 100644 --- a/routes/web.php +++ b/routes/web.php @@ -54,9 +54,12 @@ use thiagoalessio\TesseractOCR\TesseractOCR; //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]+$/i', $line)); + $serials = array_filter(array_map('trim', $lines), fn($line) => preg_match('/^[A-Za-z0-9]+$/', $line)); - return response()->json(['success' => true, 'text' => array_values($serials)]); + return response()->json([ + 'success' => true, + 'text' => array_values($serials) // reindex array + ]); } //catch (\Exception $e) { // return response()->json(['success' => false, 'error' => $e->getMessage()]);