PHPackages                             sanjabteam/verify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sanjabteam/verify

AbandonedArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

sanjabteam/verify
=================

Verify users mobile number by one time password.

v5.0.0(1y ago)364.1k9[1 PRs](https://github.com/sanjabteam/verify/pulls)MITPHPPHP ^7.3|^8

Since Apr 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sanjabteam/verify)[ Packagist](https://packagist.org/packages/sanjabteam/verify)[ Docs](https://github.com/sanjabteam/verify)[ RSS](/packages/sanjabteam-verify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (12)Used By (0)

Sanjab Verify
=============

[](#sanjab-verify)

[![Latest Stable Version](https://camo.githubusercontent.com/695a86ca2139be1bc04ccef19bbca2ae80a58237c357ee94fae18c94f7f78fbd/68747470733a2f2f706f7365722e707567782e6f72672f73616e6a61627465616d2f7665726966792f762f737461626c65)](https://packagist.org/packages/sanjabteam/verify)[![Total Downloads](https://camo.githubusercontent.com/96a6d39cae822c04819c795d34408317a4ca0cc7c87560fbadaf3fcc0eefa434/68747470733a2f2f706f7365722e707567782e6f72672f73616e6a61627465616d2f7665726966792f646f776e6c6f616473)](https://packagist.org/packages/sanjabteam/verify)[![Build Status](https://github.com/sanjabteam/verify/workflows/tests/badge.svg)](https://github.com/sanjabteam/verify/actions)[![Code Style](https://camo.githubusercontent.com/b2f19fadf7beac42d779ce6c3e4693e2ccaf8f54a602dec70db6e112fa9bbdcf/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3231343139373338332f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/214197383)[![Code Coverage](https://camo.githubusercontent.com/64ec9775ae9903cc945e33a6cb45286a373b75e7754c129d257a228d8a347469/68747470733a2f2f636f6465636f762e696f2f67682f73616e6a61627465616d2f7665726966792f6272616e63682f6d61737465722f67726170682f62616467652e7376673f73616e6974697a653d74727565)](https://codecov.io/gh/sanjabteam/verify)[![License](https://camo.githubusercontent.com/56bc4589e06f613c2a15b3ae3eab834d70e4bf6da3ddce8dc41a701cd70be6f2/68747470733a2f2f706f7365722e707567782e6f72672f73616e6a61627465616d2f7665726966792f6c6963656e7365)](https://packagist.org/packages/sanjabteam/verify)

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

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sanjabteam/verify
```

Publish config file using:

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

Configuration
-------------

[](#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
-----

[](#usage)

### Send code to the user

[](#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

[](#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
------------

[](#contributing)

Contributions are welcome!

- Fork the Project
- Clone your project (git clone [https://github.com/your\_username/verify.git](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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~156 days

Recently: every ~305 days

Total

11

Last Release

656d ago

Major Versions

v0.0.2 → v1.0.02020-07-28

v1.0.0 → v2.0.02020-09-30

v2.1.0 → v3.0.02022-05-17

v3.0.0 → v4.0.02023-03-03

v4.0.0 → v5.0.02024-07-29

PHP version history (2 changes)v0.0.1PHP ^7.2.5

v2.0.2PHP ^7.3|^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/59c159f932c988eff73d2c70af196d72a75acee87205a0c942060598877f94c6?d=identicon)[amir9480](/maintainers/amir9480)

---

Top Contributors

[![amir9480](https://avatars.githubusercontent.com/u/16279288?v=4)](https://github.com/amir9480 "amir9480 (23 commits)")[![c0mm4nDer](https://avatars.githubusercontent.com/u/20518232?v=4)](https://github.com/c0mm4nDer "c0mm4nDer (3 commits)")[![mra9994](https://avatars.githubusercontent.com/u/45072886?v=4)](https://github.com/mra9994 "mra9994 (1 commits)")[![reziamini](https://avatars.githubusercontent.com/u/29504334?v=4)](https://github.com/reziamini "reziamini (1 commits)")

---

Tags

laravellaravel-packagemobile-verificationotpotp-verificationverifysanjabteam

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sanjabteam-verify/health.svg)

```
[![Health](https://phpackages.com/badges/sanjabteam-verify/health.svg)](https://phpackages.com/packages/sanjabteam-verify)
```

###  Alternatives

[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[toddish/verify

A simple authentication bundle for Laravel 4/5. It features roles, permissions, password salting and is fully extendable.

16520.8k1](/packages/toddish-verify)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
