A Laravel package to send OTP via email & SMS. Specify different models and their columns!
composer require emotality/laravel-otp
php artisan vendor:publish --provider="Emotality\OTP\OTPServiceProvider"
- Configure your
config/otp.php
file
Import OTP
class:
use Emotality\OTP\OTP;
Send OTP to the user that just logged in:
OTP::email($user);
OTP::sms($user);
OTP::smsOrEmail($user);
OTP::smsAndEmail($user);
If OTP was entered correctly, you can remove OTP from database:
OTP::clear($user);
- Nexmo/Vonage
- PanaceaMobile
- More coming soon!
laravel-otp is released under the MIT license. See LICENSE for details.