Skip to content
/ Aadhaar Public

Aadhaar(Unique identification authority of India) package on laravel 5.

License

Notifications You must be signed in to change notification settings

Qafeen/Aadhaar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aadhaar (Unique identification authority of India) Package on laravel 5.

Authenticating users by Aaadhaar is a breeze with this package.

Installation

In order to install Aadhaar, you can do it by composer

composer require qafeen/aadhaar:@dev

or add it in your composer.json file.

"qafeen/aadhaar": "@dev"

then run composer install or composer update.

In your config/app.php file add in the providers list

Qafeen\Aadhaar\AadhaarServiceProvider::class,

And then register Aadhaar facade in aliases array

'Aadhaar' => Qafeen\Aadhaar\AadhaarFacade::class,

Api Documentation

Note: All the required parameters will be fetch from Request.

####Aadhaar::isValid() isValid(Partial match) will call aadhaar bridge api and submit a request. If user is authenticated then aadhaar-reference-code code will be return or false Note:

  1. Parameters required in Request facade is aadhaarId, pincode, name.
  2. Configuration such as modality, certificate-type will be loaded from config/aadhaar.php file.
  3. If not provided in configuration file then default value will be
return [
    'modality'         => 'demo',
    'certificate-type' => 'preprod',
];

####Aadhaar::generateOtp() Generate Otp for aadhaar request. Required parameters is aadhaarId in Request.

####Aadhaar::verifyOtp() Verify the given OTP from user. Required parameters is aadhaarId, otp in Request.

Validation

You can validate aadhaarId by simply passing valid_aadhaar to Validator

    return Validator::make($data, [
        'aadhaarId' => 'unique:users,aadhaar_id|valid_aadhaar',
    ], [
        'aadhaarId.unique' => 'Aadhaar id is already been used for registration.',
        'valid_aadhaar'    => 'Please check if your aadhaar id, pincode or name is valid as per your aadhaar card.',
    ]);

This will automatically call aadhaar bridge api and get you validated.

About

Aadhaar(Unique identification authority of India) package on laravel 5.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages