Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ankurk91/laravel-otp
One time password (OTP) generator and verifier for Laravel :calling:
https://github.com/ankurk91/laravel-otp
laravel one-time-password otp
Last synced: 2 months ago
JSON representation
One time password (OTP) generator and verifier for Laravel :calling:
- Host: GitHub
- URL: https://github.com/ankurk91/laravel-otp
- Owner: ankurk91
- License: mit
- Created: 2022-09-08T10:12:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T15:10:36.000Z (10 months ago)
- Last Synced: 2024-09-14T01:40:05.058Z (4 months ago)
- Topics: laravel, one-time-password, otp
- Language: PHP
- Homepage:
- Size: 20.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Laravel OTP
[![Packagist](https://badgen.net/packagist/v/ankurk91/laravel-otp)](https://packagist.org/packages/ankurk91/laravel-otp)
[![GitHub-tag](https://badgen.net/github/tag/ankurk91/laravel-otp)](https://github.com/ankurk91/laravel-otp/tags)
[![License](https://badgen.net/packagist/license/ankurk91/laravel-otp)](LICENSE.txt)
[![Downloads](https://badgen.net/packagist/dt/ankurk91/laravel-otp)](https://packagist.org/packages/ankurk91/laravel-otp/stats)
[![GH-Actions](https://github.com/ankurk91/laravel-otp/workflows/tests/badge.svg)](https://github.com/ankurk91/laravel-otp/actions)
[![codecov](https://codecov.io/gh/ankurk91/laravel-otp/branch/main/graph/badge.svg)](https://codecov.io/gh/ankurk91/laravel-otp)One time password (OTP) generator and verifier.
## Installation
You can install the package via composer:
```bash
composer require "ankurk91/laravel-otp"
```#### Publish the config file (optional)
You can publish the [config](./config/otp.php) file into your project.
```bash
php artisan vendor:publish --provider="Ankurk91\LaravelOTP\OTPServiceProvider" --tag="config"
```## Usage
You can use the global helper function
```php
generate($phoneNumber, 6)
// You can send $secret via SMS/Email to userotp()->match($phoneNumber, request('otp'));
otp()->forget($phoneNumber);
```or you can use Facade
```php
**Note**
> The OTP will be stored in default cache storage.## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Testing
```bash
composer test
```## Security
If you discover any security issues, please email `pro.ankurk1[at]gmail[dot]com` instead of using the issue tracker.
This packages does not follow the HOTP or TOTP specification.
## License
The [MIT](https://opensource.org/licenses/MIT) License.