PHPackages                             alexgeno/phone-verification-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. alexgeno/phone-verification-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

alexgeno/phone-verification-bundle
==================================

A bundle for phone verification via the Symfony Notifier SMS channel. Any SMS service can be used as a sender. Redis or MongoDB can be used as a storage.

v1.0.2(2y ago)668MITPHPPHP ^8.0

Since Sep 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alexeygeno/phone-verification-bundle)[ Packagist](https://packagist.org/packages/alexgeno/phone-verification-bundle)[ Docs](https://github.com/alexeygeno/phone-verification-bundle)[ RSS](/packages/alexgeno-phone-verification-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (17)Versions (4)Used By (0)

Phone Verification via [Symfony Notifier SMS Channel](https://symfony.com/doc/current/notifier.html#sms-channel)
================================================================================================================

[](#phone-verification-via-symfony-notifier-sms-channel)

[![Build Status](https://github.com/alexeygeno/phone-verification-bundle/workflows/Tests/badge.svg)](https://github.com/alexeygeno/phone-verification-bundle/actions/workflows/tests.yml)[![Build Status](https://github.com/alexeygeno/phone-verification-bundle/workflows/PHPCsFixer/badge.svg)](https://github.com/alexeygeno/phone-verification-bundle/actions/workflows/php-cs-fixer.yml)[![Build Status](https://github.com/alexeygeno/phone-verification-bundle/workflows/PHPStan/badge.svg)](https://github.com/alexeygeno/phone-verification-bundle/actions/workflows/php-stan.yml)[![Build Status](https://github.com/symfony/recipes-contrib/actions/workflows/flex-update.yml/badge.svg)](https://github.com/symfony/recipes-contrib/actions/runs/6208501110)[![Coverage Status](https://camo.githubusercontent.com/8b753b23288d1fa11eed4008c484dd1930f37ef5249655bd65be935110ac25ff/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616c6578657967656e6f2f70686f6e652d766572696669636174696f6e2d62756e646c652f62616467652e737667)](https://coveralls.io/github/alexeygeno/phone-verification-bundle)

Signing in or signing up on a modern website or mobile app typically follows these steps:

- A user initiates verification by submitting a phone number
- The user receives an SMS or a call with a one-time password [(OTP)](https://en.wikipedia.org/wiki/One-time_password)
- The user completes verification by submitting the [OTP](https://en.wikipedia.org/wiki/One-time_password)

This library is built on top of [ alexeygeno/phone-verification-php ](https://github.com/alexeygeno/phone-verification-php) and allows to set this up

Supported features
------------------

[](#supported-features)

- [Easy](#different-storages-and-sms-services) switching between different storages and SMS services
- Configurable length and expiration time for [OTP](https://en.wikipedia.org/wiki/One-time_password)
- Configurable rate limits
- Localization
- Usage with [dependency injection](https://symfony.com/doc/current/service_container.html#injecting-services-config-into-a-service) and [console commands](https://symfony.com/doc/current/console.html)
- [Flex recipe](https://github.com/symfony/recipes-contrib/tree/main/alexgeno/phone-verification-bundle/1.0) for quick start

Requirements
------------

[](#requirements)

- [Symfony 6.x](https://symfony.com/doc/6.0/index.html)
- Any of the SMS services available in [Symfony Notifier SMS Channel](https://symfony.com/doc/current/notifier.html#sms-channel): [symfony/vonage-notifier](https://github.com/symfony/vonage-notifier), [symfony/twilio-notifier](https://github.com/symfony/twilio-notifier), [symfony/message-bird-notifier](https://github.com/symfony/message-bird-notifier) and [many more ](https://symfony.com/doc/current/notifier.html#sms-channel)
- Any of the supported storages: [snc/redis-bundle](https://github.com/snc/SncRedisBundle), [doctrine/mongodb-odm-bundle](https://github.com/doctrine/DoctrineMongoDBBundle)

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

[](#installation)

```
composer require alexgeno/phone-verification-bundle snc/redis-bundle predis/predis symfony/vonage-notifier
```

**Note:** Redis as a storage and Vonage as an SMS service are defaults in the configuration

Usage
-----

[](#usage)

#### Dependency injection

[](#dependency-injection)

```
public function initiate(\AlexGeno\PhoneVerification\Manager\Initiator $manager)
{
    $manager->initiate('+15417543010');
}
```

```
public function complete(\AlexGeno\PhoneVerification\Manager\Completer $manager)
{
    $manager->complete('+15417543010', 1234);
}
```

#### Console commands

[](#console-commands)

```
bin/console phone-verification:initiate --to=+15417543010
```

```
bin/console phone-verification:complete --to=+15417543010 --otp=1234
```

#### Routes

[](#routes)

```
curl -X POST localhost/phone-verification/initiate/+15417543010
{"ok":true,"message":"Sms has been sent. Check your Phone!"}
```

```
curl -X POST localhost/phone-verification/complete/+15417543010/1234
{"ok":true,"message":"The verification is done!"}
```

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

[](#configuration)

The bundle will be automatically enabled and configured by a [Flex](https://symfony.com/doc/current/quick_tour/flex_recipes.html#flex-recipes-and-aliases) recipe. In case you don't use [Flex](https://symfony.com/doc/current/quick_tour/flex_recipes.html#flex-recipes-and-aliases), see [docs/CONFIGURATION.md](docs/CONFIGURATION.md) on how to manually do it

Different storages and SMS services
-----------------------------------

[](#different-storages-and-sms-services)

To switch between [available](#requirements) storages and SMS services, install the respective package and update the configuration. For example, to use **Mongodb** as a storage and **Twilio** as an SMS service:

```
composer require doctrine/mongodb-odm-bundle symfony/twilio-notifier
```

```
alex_geno_phone_verification:
    storage:
        driver: mongodb
        # ...
    sender:
        transport: twilio
# ...
```

If the available options are not sufficient, you can add a custom storage (implementing **\\AlexGeno\\PhoneVerification\\Storage\\I**) or/and a sender (implementing **\\AlexGeno\\PhoneVerification\\Sender\\I**), and [decorate](https://symfony.com/doc/current/service_container/service_decoration.html) the respective services (**alex\_geno\_phone\_verification.sender**, **alex\_geno\_phone\_verification.storage**) with them

**Note:** if you use **Mongodb** as a storage take a look at [docs/MIGRATIONS.md](docs/MIGRATIONS.md)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

3

Last Release

1018d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/99726792?v=4)[alexgeno](/maintainers/alexgeno)[@alexgeno](https://github.com/alexgeno)

---

Top Contributors

[![alexeygeno](https://avatars.githubusercontent.com/u/742557?v=4)](https://github.com/alexeygeno "alexeygeno (51 commits)")

---

Tags

otpAuthenticationnotificationverify2faredisphonesmstwiliomongodbsigninmongovonageverificationsignupturbosmsauthy2factorsmsapiAfricastalkingverify-by-phoneall-my-smsnotification-channelclickatellsms77messagebird46elkssipgatejusibecmsmsSmsPohvodafonetouch-smssmsc-rusms-broadcast

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alexgeno-phone-verification-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alexgeno-phone-verification-bundle/health.svg)](https://phpackages.com/packages/alexgeno-phone-verification-bundle)
```

###  Alternatives

[alexgeno/phone-verification-laravel

A library for phone verification via Laravel notification channels. Any notification channel can be used as a sender, and Redis or MongoDB can be used as a storage.

112.6k](/packages/alexgeno-phone-verification-laravel)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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