web36/laravel-otp-service
最新稳定版本:2.0.0
Composer 安装命令:
composer require web36/laravel-otp-service
包简介
This libraries is used to generate OTP for user and verify OTP for user
README 文档
README
Introduction
This libraries is used to generate OTP for user and verify OTP for user
Installation
You can install the package via composer:
composer require web36/laravel-otp-service
Configuration
As next step, let's publish config file config/otp.php by executing:
php artisan vendor:publish --provider="web36\Otp\ServiceProvider" --tag="otp-config"
Settings
Add the necessary settings for netgsm to the settings (.env ) of your project
NETGSM_USERCODE="" NETGSM_SECRET="" NETGSM_LANGUAGE="tr" NETGSM_HEADER= "" NETGSM_BRANDCODE= null NETGSM_SMS_SENDING_METHOD="xml" NETGSM_BASE_URI="" NETGSM_TIMEOUT= NETGSM_OPERATOR_CODE=""
Usage
Example 1
Sending otp for login example
use web36\Otp\Sms\NetGsmOtpMessage ; use web36\Otp\Netgsm ; use web36\Otp\MessageType\OtpMessages\NetgsmOtpMessages; class OtpServiceController extends Controller { public function sendOtp(Netgsm $netgsm) { $otp_code = rand(100000, 999999); $message = (new NetGsmOtpMessage()) // utf 8 karakter kullanılabilir. ->setMessage(NetgsmOtpMessages::getLoginMessage($otp_code)) ->setRecipients(['5xxxxxxxxx']); $jobId = $netgsm->sendSms($message); } }
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-24