aqlx86/sms-otp

SMS OTP for Laravel 5 using iSMS gateway.
692 3
Install
composer require aqlx86/sms-otp
Latest Version:v1.3.1
PHP:>=5.5.9
License:MIT
Last Updated:Sep 30, 2018
Links: GitHub  ·  Packagist
Maintainer: aqlx86

Introduction

SMS OTP for Laravel 5. By default this uses iSMS as SMS provider.

Installation

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

Publish

php artisan vendor:publish --provider="SMSOTP\SMSOTPServiceProvider"
php artisan migrate

Usage

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');

Extending

Using other SMS provider

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,

Generating your own OTP code

Do the same as creating your own SMS provider.

Related Packages

rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authe...

77,843 32
toplan/laravel-sms

A mobile phone number validation solution based on laravel

80,254 835
laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

8,789,583 258
kavenegar/laravel

laravel 4 and 5 kavenegar integration

358,904 86
laravel-notification-channels/authy

Authy notification channel for Laravel, with the ability to send in-app, sms, an...

46,701 57