| Package Data | |
|---|---|
| Maintainer Username: | aqlx86 |
| Maintainer Contact: | aqlx86@gmail.com (Arnel Labarda) |
| Package Create Date: | 2017-05-25 |
| Package Last Update: | 2018-09-30 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-23 03:05:07 |
| Package Statistics | |
|---|---|
| Total Downloads: | 692 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 3 |
| Total Watchers: | 1 |
| Total Forks: | 2 |
| Total Open Issues: | 0 |
SMS OTP for Laravel 5. By default this uses iSMS as SMS provider.
Add sms-otp to your composer.json file:
composer.phar require "aqlx86/sms-otp"
Add the service provider to your Laravel application config/app.php:
SMSOTP\SMSOTPServiceProvider::class
php artisan vendor:publish --provider="SMSOTP\SMSOTPServiceProvider"
php artisan migrate
To send OTP, remember to include :code this will be replaced with the actual code.
$sender = app()->make(OTPSender::class);
$sender->send('6399512345678', 'holy shit your otp code is :code');
To verify OTP code
$verifier = app()->make(OTPVerifier::class);
$verifier->verify('6399512345678', 'A44E8');
Create your sms provider
class CustomSMSProvider implemnts SMSOTP\Contract\SMSGateway
{
public function send($number, $message)
{
// your implemention
}
}
Update configuration config/smsotp.php
'sms' => CustomSMSProvider::class,
Do the same as creating your own SMS provider.