Skip to content
Aadhaar(Unique identification authority of India) package on laravel 5.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
composer.json
config.php

README.md

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.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.