定制 narekmarkosyan/laravel-admin-telegram-two-factor 二次开发

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

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

narekmarkosyan/laravel-admin-telegram-two-factor

最新稳定版本:v0.0.3

Composer 安装命令:

composer require narekmarkosyan/laravel-admin-telegram-two-factor

包简介

Add Telegram based two factor authentication to laravel-admin

README 文档

README

Inspired from https://github.com/shanerutter/laravel-admin-email-two-factor

Adds two-factor authentication to admin login, admin will be sent a message in Telegram with a 6-digit code to complete sign in.

Notes

A new "telegram_id" field is added to the database as laravel-admin does not have this by default. Once installed and migrations completed, you will need to set each user's email address via the database. No way of doing it via UI has been implemented at this time.

Installation

composer require narekmarkosyan/laravel-admin-telegram-two-factor

Migration

Add telegram_id field to admin users table.

php artisan migrate

Configuration

In the extensions section of the config/admin.php file, add configurations

'extensions' => [
    'auth-telegram-two-factor' => [
        'enable' => (bool)env('ADMIN_AUTH_TELEGRAM_TWO_FACTOR', true),
        'botKey' => env('ADMIN_AUTH_TELEGRAM_TWO_FACTOR_BOT_KEY', true),
        'pinLength' => (int)env('ADMIN_AUTH_TELEGRAM_TWO_FACTOR_PIN_LENGTH', 6),
        'rememberDays' => (bool)env('ADMIN_AUTH_TELEGRAM_TWO_FACTOR_REMEMBER_DAYS', 1),
    ]
]

In the .env file, add configurations

ADMIN_AUTH_TELEGRAM_TWO_FACTOR=true
ADMIN_AUTH_TELEGRAM_TWO_FACTOR_BOT_KEY=123456789:AABBB_ZXCVBNMdfghjXCVvb_AA
ADMIN_AUTH_TELEGRAM_TWO_FACTOR_PIN_LENGTH=6
ADMIN_AUTH_TELEGRAM_TWO_FACTOR_REMEMBER_DAYS=1

License

Licensed under The MIT License (MIT).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-04