PHPackages                             controlbit/reset-code - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. controlbit/reset-code

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

controlbit/reset-code
=====================

v0.1.1(8mo ago)09proprietaryPHPPHP &gt;=8.3

Since Sep 14Pushed 8mo agoCompare

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

READMEChangelog (2)Dependencies (13)Versions (3)Used By (0)

ResetCode Bundle
================

[](#resetcode-bundle)

The ResetCode Bundle provides a simple, database-backed way to generate and manage temporary reset codes (e.g., verification codes, one-time passwords, password reset tokens). It integrates with Doctrine DBAL and automatically manages schema creation via Doctrine schema events.

Features

🔑 Generate short-lived reset codes with configurable size and TTL.
🗄️ Multiple tables supported, each with its own configuration.
🎭 Aliases for services to easily access different code managers.
⚡ Automatic Doctrine schema updates via event listeners.

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

[](#installation)

```
composer require controlbit/reset-code
```

Put in Bundles file of your Symfony project:

```
return [
    ControlBit\ResetCode\ResetCodeBundle::class => ['all' => true],
];
```

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

[](#configuration)

```
# config/packages/reset_code.yaml
reset_code:
  enabled: true

  tables:
    - name: "password_reset"
      alias: "user_reset"
      connection_name: "default"
      code_size: 6
      ttl: 300
      timeout_to_clear_oldest_ms: 250
      allow_subject_duplicates: false

    - name: "phone_verification"
      alias: null
      connection_name: "readonly"
      code_size: 4
      ttl: 120
      timeout_to_clear_oldest_ms: 500
      allow_subject_duplicates: true
```

Usage
-----

[](#usage)

Each configured table automatically registers a ResetCodeManager service.
Service IDs are built as:

reset\_code.{name}
reset\_code.{alias} (if alias is set)
reset\_code.default (first configured table, acts as fallback)

You can also type-hint `ControlBit\ResetCode\Service\ResetCodeManager` in your services — it will resolve to the default manager.

### Example of generating a code:

[](#example-of-generating-a-code)

```
use ControlBit\ResetCode\Service\ResetCodeManager;

class PasswordResetService
{
    public function __construct(private ResetCodeManager $resetCodeManager) {}

    public function requestReset(string $userId): string
    {
        return $this->resetCodeManager->generateCode($userId);
    }
}
```

If you configured multiple tables:

```
$phoneResetManager = $container->get('reset_code.phone_verification');
$code = $phoneResetManager->generateCode($phoneNumber);
```

Database migrations
-------------------

[](#database-migrations)

Generate migration or do schema update:

```
php bin/console doctrine:schema:update --force
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance61

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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 ~0 days

Total

2

Last Release

246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ac580ac8e9fb7afc42de276664939a427f746cdc210f7348a41454cdbf0ecfc6?d=identicon)[choks87](/maintainers/choks87)

---

Top Contributors

[![choks87](https://avatars.githubusercontent.com/u/37302106?v=4)](https://github.com/choks87 "choks87 (11 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/controlbit-reset-code/health.svg)

```
[![Health](https://phpackages.com/badges/controlbit-reset-code/health.svg)](https://phpackages.com/packages/controlbit-reset-code)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2755.3M13](/packages/pentatrion-vite-bundle)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[robole/sulu-ai-translator-bundle

Translate any type of content using DeepL

181.3k](/packages/robole-sulu-ai-translator-bundle)

PHPackages © 2026

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