Package Data | |
---|---|
Maintainer Username: | qafeen |
Maintainer Contact: | hello@mudasir.me (Mohammed Mudasir) |
Package Create Date: | 2016-10-15 |
Package Last Update: | 2016-10-16 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-19 03:25:41 |
Package Statistics | |
---|---|
Total Downloads: | 362 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 10 |
Total Watchers: | 7 |
Total Forks: | 3 |
Total Open Issues: | 1 |
Authenticating users by Aaadhaar is a breeze with this package.
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,
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:
Request
facade is aadhaarId
, pincode
, name
.modality
, certificate-type
will be loaded from config/aadhaar.php
file.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
.
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.