Looking to hire Laravel developers? Try LaraJobs

laravel-otp maintained by hellojie

Description
A simple OTP package
Author
Last update
2022/11/27 10:43 (dev-main)
License
Links
Downloads
1

Comments
comments powered by Disqus

Laravel Otp

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

Introduction

A simple OTP package for laravel 9.

Installation

composer require hellojie/laravel-otp:dev-main

Publish the migrations

php artisan vendor:publish

Usage

Generate OTP

<?php
use Hellojie\LaravelOtp\OtpService;

/** @var OtpService $otpService */
$otpService = app(OtpService::class);
$token = $otpService->generate('test-key');

Validate OTP

<?php

use Hellojie\LaravelOtp\OtpService;

/** @var OtpService $otpService */
$otpService = app(OtpService::class);
$isValid = $otpService->validate('test-key', 'test-token');