Level 1
Google Tesseract package can be used to read data from images and JSON-formatted data can be simply indexed like form data is indexed... for pdf files first we have to convert the pdf pages into images and then by using Google Tesseract we can do the same...
here is how you can read text from image using Google Tesseract
public function processUploadedFile(Request $request) {
$request->validate([
'uploaded_file' => 'required|image|mimes:jpeg,png,jpg,gif',
]);
$uploadedFile = $request->file('uploaded_file');
$filePath = $uploadedFile->storeAs('uploads', $uploadedFile->getClientOriginalName(), 'public');
$text = (new TesseractOCR(storage_path("app/public/{$filePath}")))->run();
return response()->json(['text' => $text]);
}