PHPackages                             upaid/sms-verification - 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. upaid/sms-verification

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

upaid/sms-verification
======================

This package provides a convenient tool for sending and verifying SMS codes in different flows. Works only with Laravel framework

0.1.10(5y ago)06.7kMITPHPPHP &gt;=7.0.0

Since Jun 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/uPaid/sms-verification)[ Packagist](https://packagist.org/packages/upaid/sms-verification)[ Docs](https://github.com/uPaid/sms-verification)[ RSS](/packages/upaid-sms-verification/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (8)Versions (9)Used By (0)

SMS code verification
=====================

[](#sms-code-verification)

[![License: MIT](https://camo.githubusercontent.com/c2bffd81d308ced1cc3b0d66fb0ed453ab478a5e17c988b780f9de986a390ee2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)This package provides a set of tools for sending and verifying SMS codes.

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

[](#installation)

This package can be installed through Composer:

```
composer require upaid/sms-verification
```

Or by adding the following line to the `require` section of your Laravel app's `composer.json` file:

```
    "require": {
        "upaid/sms-verification": "0.1.*"
    }
```

Run `composer update upaid/sms-verification` to install the package.

Overview
--------

[](#overview)

The core part of the package are so called "managers" - classes that implement the following interface:

```
interface SmsManagerInterface
{
    public function sendSmsCode(string $action, string $phone, array $messageTranslationPlaceholders = []): string;
    public function checkSmsCode(string $action, string $phone, string $code): string;
    public function sendSmsAgain(string $action, string $phone, array $messageTranslationPlaceholders = []): string;
    public function flushPendingSmsValidation(string $id): void;
}
```

Short description below:

- *sendSmsCode* - generates code, stores it in cache in context of a given action and phone number, sends a text message with generated code and returns status of this operation
- *checkSmsCode* - checks if a given code is the same as the one stored in cache (in the same context) and returns status; in addition it is prepared to handle reaching the limit of failed attempts (you can define how to do that in config and in callbacks)
- *sendSmsAgain* - resets the counter of failed check attempts and then does the same as *sendSmsCode* (you can limitate usage of this method in config)
- *flushPendingSmsValidation* - removes all SMS verification keys from cache (can be used for example when user logs in) Of course all of these subtasks are delegated to dependencies injected via interface, so you can modify most part of this packages without editing existing classes.

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

[](#configuration)

Package configuration is placed in *config/sms\_verification.php* file. You have to copy this file to *config* folder in your Laravel project. In order to do that you can execute

```
php artisan vendor:publish --tag=config
```

Below is a list of configurable options:

- *api* - SMS API connection settings
- *log\_message* - templates used to log sent messages (if logging is configured)
- *status\_map* - used for customising returned statuses
- *status\_placeholders* - used for customizing the format of returned information about sent SMS number/count (if returned from SMS API)
- *multi\_lock\_types* - determines the list of available lock types used at *MultiTypeLockManager* class
- *cache\_life\_time* - how long items are stored in cache
- *lock\_life\_time* - lock duration (used in *BaseCacheLockManager*, not tightly related to the core functionality, but important if you use locks)
- *sms\_code\_length* - length of generated SMS verification code
- *checks\_limit* - max number of failed check attempts for one SMS code; reaching this limit may cause creating a lock or resending SMS code, depending on which manager you use
- *send\_again\_limit* - defines how many times *sendSmsAgain* feature can be used in given context. Used in *LimitedResendManager* class
- *actions* - list of available actions. Class *Components/Actions* should be overridden and extended in your project
- *translations* - translation configuration. If you use Laravel translator (*Components/Callbacks/MessageComposer*) pass to this parameter array with format \[action =&gt; translation\_key\]. Also you can override *MessageComposer* implementation in your project
- *dummy\_services\_environments* - list of environments for which will be used dummy sender
- *force\_use\_real\_services* - if true send real sms even if environment is at the list of *dummy\_services\_environments*
- *callbacks* - the list of configurable callbacks. You can define your own callback classes by implementing method *\_\_invoke*
    - *dummy\_services* - you have to pass callback class that makes a decision if a real SMS code should be generated and sent (or a dummy sender should be used, alternatively). Dummy sender logs the message without real sending (if logging is configured)
    - *manager* - you have to pass callback that creates at instance of *SmsManagerInterface*
    - *log* - pass callback implementing logging
    - *over\_limit* - this callback is executed when reaching *send\_again\_limit* in *LimitedResendManager*
    - *message\_composer* - responsible for composing and translating SMS message content
    - *lock\_manager* - callback creates an instance of *LockManagerInterface* that can be used to lock user in cache or in DB, or to lock only some of the features (like password reset or email change)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~140 days

Recently: every ~243 days

Total

8

Last Release

1898d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18398854?v=4)[uPaid Sp. z o.o](/maintainers/uPaid)[@uPaid](https://github.com/uPaid)

---

Top Contributors

[![uPaid](https://avatars.githubusercontent.com/u/18398854?v=4)](https://github.com/uPaid "uPaid (2 commits)")[![marianowicz](https://avatars.githubusercontent.com/u/23335315?v=4)](https://github.com/marianowicz "marianowicz (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/upaid-sms-verification/health.svg)

```
[![Health](https://phpackages.com/badges/upaid-sms-verification/health.svg)](https://phpackages.com/packages/upaid-sms-verification)
```

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M162](/packages/google-auth)[josiasmontag/laravel-recaptchav3

Recaptcha V3 for Laravel package

2641.6M2](/packages/josiasmontag-laravel-recaptchav3)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[rahul900day/laravel-captcha

Different types of Captcha implementation for Laravel Application.

10715.9k](/packages/rahul900day-laravel-captcha)

PHPackages © 2026

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