viezel/otp
Composer 安装命令:
composer require viezel/otp
包简介
One Time Password for Laravel
关键字:
README 文档
README
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.
Installation
- Install the package via composer:
composer require viezel/otp php artisan vendor:publish --provider="Viezel\OTP\OTPServiceProvider" --tag="migrations" php artisan migrate
- Add Middleware
check_otpto 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
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-23
