PHPackages                             wearesho-team/yii-tokens - 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. wearesho-team/yii-tokens

Abandoned → [wearesho-team/yii2-tokens](/?search=wearesho-team%2Fyii2-tokens)Proprietary[Utility &amp; Helpers](/categories/utility)

wearesho-team/yii-tokens
========================

Yii2 Tokens Library (internal, legacy)

5.1.0(1y ago)0576[1 PRs](https://github.com/wearesho-team/yii-tokens/pulls)MITPHPPHP ^8.1

Since Sep 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/wearesho-team/yii-tokens)[ Packagist](https://packagist.org/packages/wearesho-team/yii-tokens)[ RSS](/packages/wearesho-team-yii-tokens/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (8)Versions (36)Used By (0)

Yii2 Tokens
-----------

[](#yii2-tokens)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7ce996a90de52de4aa866b248dc6e2bb72c5f4495d2befe50ff9995e46672432/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776561726573686f2d7465616d2f7969692d746f6b656e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wearesho-team/yii-tokens/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/a0f248b34ff0cac53d0d2e0839e5b7b26fd9947d33dd064d0e20f472e26d13fa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776561726573686f2d7465616d2f7969692d746f6b656e732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wearesho-team/yii-tokes/?branch=master)[![Build Status](https://camo.githubusercontent.com/7fd28f34f0344c31ec8dbb1d1b8fbbbebe37aa0d2307cd64b817f067b023303b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776561726573686f2d7465616d2f7969692d746f6b656e732f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wearesho-team/yii-tokens/build-status/master)

Verifying some action by sending token (SMS, Email, Telegram etc.) Compatible only with MySQL and PostgreSQL
[CHANGELOG](./CHANGELOG.md)

### Installation

[](#installation)

```
composer require wearesho-team/yii-tokens:^6.0
```

### Migrations

[](#migrations)

- Copy migrations into your project

```
cd path-to-your-project
cp -R ./vendor/wearesho-team/yii-tokens/migrations ./console/migrations
```

### Configuration

[](#configuration)

#### Environment

[](#environment)

Default *[TokenRepositoryConfig](./src/Configs/TokenRepositoryConfig.php)* loads configuration from environment variables. Environment variables name may be changed, defaults:

- **TOKEN\_EXPIRE\_MINUTES** - minutes from creating token when it will be invalidated
- **TOKEN\_VERIFY\_LIMIT** - maximum verifying limit (used by [TokenValidator](./src/Validators/TokenValidator.php))
- **TOKEN\_DELIVERY\_LIMIT** - maximum sending limit (used by [TokenRepository](./src/Repositories/TokenRepository.php), *send* method)

#### Container

[](#container)

You should configure your DI-container to use environment config:

```
