Skip to content

ReferenceFrame/identitydocuments

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Identity Documents

Latest Version on Packagist Total Downloads StyleCI

For general questions and suggestions join gitter:

Join the chat at https://gitter.im/werk365/identitydocuments

Package to parse Machine Readable Passports and other travel documents from image in Laravel.

MRZ is parsed and validated by check numbers and returned.

Installation

Via Composer

$ composer require werk365/identitydocuments

Publish config

$ php artisan vendor:publish --provider="werk365\identitydocuments\IdentityDocumentsServiceProvider"

Usage

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.

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email hergen.dillema@gmail.com instead of using the issue tracker.

Credits

License

. Please see the license file for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%