qafeen / aadhaar
Aaadhaar Bridge for laravel.
Requires
- guzzlehttp/guzzle: ^6.2
- laravel/framework: ^5.1
Requires (Dev)
- modelizer/selenium: ^1.0
This package is not auto-updated.
Last update: 2024-11-09 20:45:13 UTC
README
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:
- Parameters required in
Request
facade isaadhaarId
,pincode
,name
. - Configuration such as
modality
,certificate-type
will be loaded fromconfig/aadhaar.php
file. - 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.