All Projects → sanjabteam → verify

sanjabteam / verify

Licence: MIT License
Laravel package to verify users with a one-time password (OTP)

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to verify

DPOTPView
Customisable OTP view and Passcode view
Stars: ✭ 52 (+108%)
Mutual labels:  otp, otp-verification
passwordless
Passwordless authentication server, supports OTP, WebAuthn, plan to implement TOTP and mobile biometric authentication
Stars: ✭ 34 (+36%)
Mutual labels:  otp, otp-verification
laravel-string-similarities
Compare two string and get a similarity percentage
Stars: ✭ 54 (+116%)
Mutual labels:  laravel-package
sms
Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5(Updated to work with Laravel 5.5).Currently supported Gateways Clickatell, MVaayoo, Gupshup, SmsAchariya, SmsCountry, SmsLane, Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.
Stars: ✭ 41 (+64%)
Mutual labels:  laravel-package
Firebase-Phone-Auth-Demo
Demo Project to show how to use Phone Authentication in Flutter with Firebase backend
Stars: ✭ 75 (+200%)
Mutual labels:  otp
laravel-blade-on-demand
Compile Blade templates in memory
Stars: ✭ 36 (+44%)
Mutual labels:  laravel-package
adminetic
Admin starter kit with user, role and permission, activity, settings and preference management along with CRUD, ACL, BREAD Permission, Repo Pattern, SuperAdmin Generator
Stars: ✭ 19 (-24%)
Mutual labels:  laravel-package
csv
No description or website provided.
Stars: ✭ 47 (+88%)
Mutual labels:  laravel-package
rememberable
Laravel Traits for fast integration of model caching
Stars: ✭ 28 (+12%)
Mutual labels:  laravel-package
otp-tutorial
Introductory tutorial (approx. 3 hours) covering the setup and querying of an OpenTripPlanner instance
Stars: ✭ 85 (+240%)
Mutual labels:  otp
getui
Getui sdk package for laravel.
Stars: ✭ 19 (-24%)
Mutual labels:  laravel-package
react-native-sms-user-consent
React Native wrapper for Android's SMS User Consent API, ready to use in React Native apps with minimum effort.
Stars: ✭ 45 (+80%)
Mutual labels:  otp
LaravelSapient
Sapient Integration for Laravel
Stars: ✭ 13 (-48%)
Mutual labels:  laravel-package
OneTime
iOS, watchOS, & macOS One-Time Password client
Stars: ✭ 14 (-44%)
Mutual labels:  otp
video-downloader
Video Downloader for Facebook.
Stars: ✭ 63 (+152%)
Mutual labels:  laravel-package
Xshell-OTP
Xshell Semi-Automatic complete One-time Password login
Stars: ✭ 29 (+16%)
Mutual labels:  otp
PassCodeText
A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customizability.
Stars: ✭ 105 (+320%)
Mutual labels:  otp
reports
UI for created and download reports in Laravel
Stars: ✭ 13 (-48%)
Mutual labels:  laravel-package
luaotp
A simple implementation of OATH-HOTP and OATH-TOTP written for Lua
Stars: ✭ 26 (+4%)
Mutual labels:  otp
woocommerce-otpbank-payment-gateway
WooCommerce Payment Gateway for OTP Bank (Hungary)
Stars: ✭ 20 (-20%)
Mutual labels:  otp

Sanjab Verify

Latest Stable Version Total Downloads Build Status Code Style Code Coverage License

Verify your user mobile/email with a one-time password.

Installation

You can install the package via composer:

composer require sanjabteam/verify

Publish config file using:

php artisan vendor:publish --provider=SanjabVerify\VerifyServiceProvider

Configuration

code: Unique code generator configs.

resend_delay : Resend delay between code sends in seconds.

expire_in: Expire sent code after minutes.

max_attemps: Max code check attempts.

max_resends: Maximum resends in one hour.

  • per_session: Maximum resends in one hour based on the user session. (Limitation: if user clear cookie)
  • per_ip: Maximum resends in one hour based on user IP. (Limitation: If two different user use one proxy)

Usage

Send code to the user

use Verify;
use App\Helpers\SmsVerifyMethod;

$result = Verify::request($request->input('mobile'), SmsVerifyMethod::class);

if ($result['success'] == false) { // If user exceed limitation
    return redirect()->back()->with('error', $result['message']); // Show error message
}

App\Helpers\SmsVerifyMethod is your send method class and you need to create that like this.

namespace App\Helpers;

use SanjabVerify\Contracts\VerifyMethod;

class SmsVerifyMethod implements VerifyMethod
{
    public function send(string $receiver, string $code)
    {
        // Send code to receiver
        if (send_sms($receiver, 'Your code is :'.$code) == 'success') {
            return true; // If code sent successfuly then return true
        }
        return false; // If send code failed return false
    }
}

Verify

You can verify code with request validation.

$request->validate([
    'code' => 'required|sanjab_verify:mobile'
]);

mobile is your receiver which in this case is mobile.

You can also verify it manually.

use Verify;

$result = Verify::verify($request->input('mobile'), $request->input('code'));
if ($result['success'] == false) {
    // Show error $result['message']
}

Note: You can verify a code just once. so if you need to check code in two different requests then you should use something like the session to handle that.

Contributing

Contributions are welcome!

  • Fork the Project
  • Clone your project (git clone https://github.com/your_username/verify.git)
  • Create new branch (git checkout -b your_feature)
  • Commit your Changes (git commit -m 'new feature')
  • Push to the Branch (git push origin your_feature)
  • Open a Pull Request

Donation

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].