定制 viezel/otp 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

viezel/otp

Composer 安装命令:

composer require viezel/otp

包简介

One Time Password for Laravel

关键字:

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Type Coverage

This package is sending out a 6 digit verification code per email, when a user visits a route in your Laravel app. By default, the user identity verification will be valid for 30 minutes.

Verify

Installation

  1. Install the package via composer:
composer require viezel/otp
php artisan vendor:publish --provider="Viezel\OTP\OTPServiceProvider" --tag="migrations"
php artisan migrate
  1. Add Middleware check_otp to the routes that should verify the User Identity.
Route::get('some/protected/route', MyController::class)->middleware(['auth', 'check_otp']);
Route::get('other/route', MyOtherController::class)->middleware(['auth', 'check_otp']);

Config

You can publish the config file with:

php artisan vendor:publish --provider="Viezel\OTP\OTPServiceProvider" --tag="otp-config"
return [
    /*
     * How long time in minutes should the verification code be valid for
     */
    'link_expires_in_minutes' => 300,

    /*
     * How long time in minutes should the user be verified for the certain route
     */
    'validation_expires_after_minutes' => 30,

    /*
     * Should be use the queue to sent out the verification email
     */
    'use_queue' => false,

    /*
     * Route Prefix
     */
    'route_prefix' => '',

    /*
     * Route Middleware
     */
    'route_middleware' => ['web', 'auth'],
];

Customize

You can build up your own verification view. Just publish the views and change what you need.

The package provides a blade component to reuse. Its based on Alpine.js and Tailwind CSS.

<x-otp::pincode url="{{ $url }}"></x-otp::pincode>

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固