承接 advancelearn/otp-auth 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

advancelearn/otp-auth

Composer 安装命令:

composer require advancelearn/otp-auth

包简介

otp generate for one field from client and after create otp you can checked is true token

README 文档

README

#Advancelearn Otp-auth

advancelearn-otp-auth

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Introduction

Welcome to the first package from AdvanceLearn Academy. In this package, we tried to make it easy to create a validation code that is easily available to you, and after receiving the code and token, send it to the user via SMS or email to fill in the form. Validate the user to enter this token and then we will validate the token with the username you send and return the result to you.

Installation

You can install the package with Composer.

composer require advancelearn/otp-auth

Usage

The advancelearn/otp-auth, It is enough to create an object from the main class of the package and in the first step, call the method related to creating the token and send the value of the username to it.

new Object of advancelearn/otp-auth:

and call generateToken method::

$package = new OtpHandlerAdvancelearn();

add namespace of package to top your php class

use Advancelearn\OtpAuth\OtpHandlerAdvancelearn;

now call method generateToken and passed data for generate new token and set time for caching otp code

$username = request()->input('username');
$token = $package->generateToken(['username' => $username , 'time' => 3]);

Username can be the user's email or mobile phone

In this section, you have received the code. Now, according to your project scenario, you can send the validation code to the user, and in the next step, receive the token from the user and send it to the package validation method for accuracy:

$token = request()->input('token');
 return $package->verify(['token' => $token , 'username' => $username]);

//example output: If the token is correct than the user's username
{
    "success": "Token is verified you can register or logged in user",
    "status": true
}

Conclusion

With this advanced learning package called advancelearn/otp-auth, you can easily send the user's username and receive the token, and you will not have the trouble of creating or saving the token in the database, because the token for the user's username is easily cached according to the time you give. and in the second step, the token validation is applied to the requested username, and according to that, you can successfully register the user in the system or direct the user to the resend code page.

advancelearn/otp-auth 适用场景与选型建议

advancelearn/otp-auth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 8, 最近一次更新时间为 2023 年 09 月 10 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「auth」 「laravel」 「laravel package」 「Laravel Auth」 「otp-auth」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 advancelearn/otp-auth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 advancelearn/otp-auth 我们能提供哪些服务?
定制开发 / 二次开发

基于 advancelearn/otp-auth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-10