For general questions and suggestions join gitter:
Package to parse Machine Readable Passports and other travel documents from image in Laravel.
MRZ is parsed and validated by check numbers and returned.
Via Composer
$ composer require werk365/identitydocuments
Publish config
$ php artisan vendor:publish --provider="werk365\identitydocuments\IdentityDocumentsServiceProvider"
This package uses Google's Vision API to do OCR, this requires you to make a service account and download the JSON keyfile. In order to use it in this project, store the key found in the file as an array in config/google_key.php like this:
return [
"type" => "service_account",
"project_id" => "",
"private_key_id" => "",
"private_key" => "",
"client_email" => "",
"client_id" => "",
"auth_uri" => "",
"token_uri" => "",
"auth_provider_x509_cert_url" => "",
"client_x509_cert_url" => "",
];
Call the parse method from anywhere passing a POST request. The method expects 'front_img' and 'back_img' to be the images of the travel documents, although you can use only one if a single image contains all required data.
use werk365\IdentityDocuments\IdentityDocuments;
public function annotate(Request $request){
return IdentityDocuments::parse($request);
}
This returns the document type, MRZ, the parsed MRZ and all raw text found on the images.
Please see the changelog for more information on what has changed recently.
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email hergen.dillema@gmail.com instead of using the issue tracker.
. Please see the license file for more information.